public override void Write(object obj, ES2Writer writer)
 {
     Devdog.InventorySystem.Models.InventoryItemSaveLookup data = (Devdog.InventorySystem.Models.InventoryItemSaveLookup)obj;
     // Add your writer.Write calls here.
     writer.Write(data.itemID);
     writer.Write(data.amount);
 }
    public override object Read(ES2Reader reader)
    {
        Devdog.InventorySystem.Models.InventoryItemSaveLookup data = new Devdog.InventorySystem.Models.InventoryItemSaveLookup();
        // Add your reader.Read calls here and return your object.
        data.itemID = reader.Read <System.Int32>();
        data.amount = reader.Read <System.UInt32>();

        return(data);
    }
	public override object Read(ES2Reader reader)
	{
        Devdog.InventorySystem.Models.InventoryItemSaveLookup data = new Devdog.InventorySystem.Models.InventoryItemSaveLookup();
		// Add your reader.Read calls here and return your object.
		data.itemID = reader.Read<System.Int32>();
		data.amount = reader.Read<System.UInt32>();

		return data;
	}
        public static InventoryItemSaveLookup[] GetCollectionLookups(ItemCollectionBase collection)
        {
            var l = new InventoryItemSaveLookup[collection.items.Length];
            for (int i = 0; i < collection.items.Length; i++)
            {
                if (collection.items[i].item == null)
                    l[i] = new InventoryItemSaveLookup(-1, 0);
                else
                    l[i] = new InventoryItemSaveLookup((int)collection.items[i].item.ID, collection.items[i].item.currentStackSize);                
            }

            return l;
        }