Exemplo n.º 1
0
        public static Item Load(ItemSave save)
        {
            Item item = new Item();

            item.Name        = save.Name;
            item.ItemType    = save.ItemType;
            item.Description = save.Description;
            item.Stats       = save.Stats;
            return(item);
        }
Exemplo n.º 2
0
        public static ItemSave Save(Item item)
        {
            ItemSave save = new ItemSave();

            save.Name        = item.Name;
            save.ItemType    = item.ItemType;
            save.Description = item.Description;
            save.Stats       = item.Stats;
            return(save);
        }
Exemplo n.º 3
0
        public static EquippedItems Load(EquippedItemsSave save)
        {
            EquippedItems items = new EquippedItems();

            items.Helmet     = ItemSave.Load(save.Helmet);
            items.Chestplate = ItemSave.Load(save.Chestplate);
            items.Leggings   = ItemSave.Load(save.Leggings);
            items.Boots      = ItemSave.Load(save.Boots);
            items.Weapon     = ItemSave.Load(save.Weapon);
            return(items);
        }
Exemplo n.º 4
0
        public static Inventory Load(InventorySave save)
        {
            Inventory inventory = new Inventory();

            inventory.Items = new List <Item>();
            foreach (ItemSave itemSave in save.Items)
            {
                inventory.Items.Add(ItemSave.Load(itemSave));
            }
            inventory.EquippedItems = EquippedItemsSave.Load(save.EquippedItems);
            return(inventory);
        }
Exemplo n.º 5
0
        public static EquippedItemsSave Save(EquippedItems items)
        {
            EquippedItemsSave save = new EquippedItemsSave();

            save.Helmet     = ItemSave.Save(items.Helmet);
            save.Chestplate = ItemSave.Save(items.Chestplate);
            save.Leggings   = ItemSave.Save(items.Leggings);
            save.Boots      = ItemSave.Save(items.Boots);
            save.Weapon     = ItemSave.Save(items.Weapon);

            return(save);
        }
Exemplo n.º 6
0
        public static InventorySave Save(Inventory inventory)
        {
            InventorySave inventorySave = new InventorySave();

            inventorySave.Items = new List <ItemSave>();
            foreach (Item item in inventory.Items)
            {
                inventorySave.Items.Add(ItemSave.Save(item));
            }

            inventorySave.EquippedItems = EquippedItemsSave.Save(inventory.EquippedItems);

            return(inventorySave);
        }