public void Remove(InventoryType.ItemType type, byte slot) { Item item = this.Items.Find(i => (i.Type == (byte)type && i.Slot == slot)); this.Items.Remove(item); item.Delete(); }
public int Term(InventoryType.ItemType type, byte slot) { Item item = this.Items.Find(i => (i.Type == (byte)type && i.Slot == slot)); if (item == null) { return(0); } return(item.Term); }
public byte IsLocked(InventoryType.ItemType type, byte slot) { Item item = this.Items.Find(i => (i.Type == (byte)type && i.Slot == slot)); if (item == null) { return(0); } return(item.IsLocked); }
public byte Fusion(InventoryType.ItemType Type, byte Slot) { Item Item = this.Items.Find(i => (i.Type == (byte)Type && i.Slot == Slot)); if (Item == null) { return(0); } return(Item.Fusion); }
public int Quantity(InventoryType.ItemType Type, byte Slot) { Storage Item = this.Storages.Find(i => (i.ItemID != 0 && i.Quantity != 0 && i.Type == (byte)Type && i.Slot == Slot)); if (Item == null) { return(0); } return(Item.Quantity); }
public int Slot(InventoryType.ItemType Type) { foreach (KeyValuePair <byte, byte> UseSlot in this) { if (UseSlot.Key == (byte)Type) { return(UseSlot.Value); } } return(-1); }
public byte GetNextFreeSlot(InventoryType.ItemType Type) { for (byte i = 0; i < 24; i++) { if (this[Type, i] == null) { return(i); } } throw new InventoryFullException(); }
public bool IsFull(InventoryType.ItemType type) { short count = 0; foreach (Item item in this) { if (item.Type == (byte)type) { count++; } } return(count == this.MaxSlots[type]); }
public Pet this[InventoryType.ItemType type, byte slot] { get { foreach (Pet Pet in this) { if (Pet.Type == (byte)type && Pet.Slot == slot) { return(Pet); } } return(null); } }
public Item this[InventoryType.ItemType type, byte slot] { get { foreach (Item item in this) { if (item.Type == (byte)type && item.Slot == slot) { return(item); } } return(null); } }
public int Spirit(InventoryType.ItemType Type, byte Slot) { Item Item = this.Items.Find(i => (i.Type == (byte)Type && i.Slot == Slot)); if (Item == null) { return(0); } ItemData Data = ItemFactory.GetItemData(Item.ItemID); if (Data == null) { return(0); } if (Item.Spirit > Data.Spirit) { return(Data.Spirit); } return(Item.Spirit); }