Beispiel #1
0
        private List <CharacterClassLibrary.Item> getItems(List <DAO.Item> items)
        {
            var list = new List <CharacterClassLibrary.Item>();

            foreach (var item in items)
            {
                var thing = new CharacterClassLibrary.Item(item.Health, item.Strength, item.Crit, item.SpellPower,
                                                           item.Armor, item.Name, 1, (ItemType)item.Type, (ItemPlace)item.Place, item.Owner, (ItemQuality)item.Quality);
                list.Add(thing);
            }
            return(list);
        }
Beispiel #2
0
        private DAO.Item convertToDbItem(CharacterClassLibrary.Item item)
        {
            var dbItem = new DAO.Item();

            dbItem.Armor      = item.Armor;
            dbItem.Crit       = item.Crit;
            dbItem.Health     = item.Health;
            dbItem.Owner      = item.Owner;
            dbItem.Place      = Convert.ToInt32(item.ItemPlace);
            dbItem.SpellPower = item.Spellpower;
            dbItem.Strength   = item.Strength;
            dbItem.Type       = Convert.ToInt32(item.ItemType);
            dbItem.Name       = item.Name;
            dbItem.SellValue  = item.SellValue;
            return(dbItem);
        }
Beispiel #3
0
        private List <CharacterClassLibrary.Item> convertItems(List <DAL.Item> items)
        {
            var list = new List <CharacterClassLibrary.Item>();

            foreach (var item in items)
            {
                var CItem = new CharacterClassLibrary.Item();
                CItem.Name       = item.Name;
                CItem.Owner      = item.Owner;
                CItem.Health     = item.Health;
                CItem.Strength   = item.Strength;
                CItem.Spellpower = item.SpellPower;
                CItem.Crit       = item.Crit;
                CItem.Armor      = item.Armor;
                CItem.SellValue  = item.SellValue;
                CItem.ItemPlace  = (ItemPlace)Enum.Parse(typeof(ItemPlace), item.ItemPlace.ToString());
                CItem.ItemType   = (ItemType)Enum.Parse(typeof(ItemType), item.ItemType.ToString());
                CItem.Quality    = (ItemQuality)Enum.Parse(typeof(ItemQuality), item.ItemQuality.ToString());
                list.Add(CItem);
            }
            return(list);
        }