示例#1
0
        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();
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
 public int Slot(InventoryType.ItemType Type)
 {
     foreach (KeyValuePair <byte, byte> UseSlot in this)
     {
         if (UseSlot.Key == (byte)Type)
         {
             return(UseSlot.Value);
         }
     }
     return(-1);
 }
示例#7
0
        public byte GetNextFreeSlot(InventoryType.ItemType Type)
        {
            for (byte i = 0; i < 24; i++)
            {
                if (this[Type, i] == null)
                {
                    return(i);
                }
            }

            throw new InventoryFullException();
        }
示例#8
0
        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]);
        }
示例#9
0
        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);
            }
        }
示例#10
0
        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);
            }
        }
示例#11
0
        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);
        }