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); }
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); }
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); }
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); }
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); }
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); }