Example #1
0
 public bool AddEquipment(ConquerItem Item, ItemPosition Position)
 {
     Item.Position = Position;
     Equipment.ThreadSafeAdd(Position, Item);
     Item.Send(this);
     return(true);
 }
Example #2
0
 public bool TryGetEquipment(ItemPosition Position, out ConquerItem Item)
 {
     Item = default(ConquerItem);
     if (Equipment.ContainsKey(Position))
     {
         Item = Equipment[Position];
         return(true);
     }
     return(false);
 }
Example #3
0
 public bool TryGetInventory(uint UID, out ConquerItem Item)
 {
     Item = default(ConquerItem);
     lock (Inventory)
     {
         Item = Inventory.Find((item) => { return(item.UID == UID); });
         if (Item != null)
         {
             return(true);
         }
     }
     return(false);
 }
Example #4
0
        public bool RemoveInventory(ConquerItem Item)
        {
            bool Removed = false;

            lock (Inventory)
            {
                Removed = Inventory.Remove(Item);
                if (Removed)
                {
                    Item.RemoveInventory(this);
                }
            }
            return(Removed);
        }
Example #5
0
 public bool AddInventory(ConquerItem Item)
 {
     lock (Inventory)
     {
         if (Inventory.Count < 40)
         {
             Item.Position = ItemPosition.Inventory;
             Item.Send(this);
             Inventory.Add(Item);
             return(true);
         }
         return(false);
     }
 }
Example #6
0
 public void Unequip(ConquerItem Item, ItemPosition Position)
 {
     Item.Position = Position;
     Item.Unequip(this);
     Equipment.ThreadSafeRemove(Position);
 }
Example #7
0
 public bool AddEquipment(ConquerItem Item, ItemPosition Position)
 {
     Item.Position = Position;
     Equipment.ThreadSafeAdd(Position, Item);
     Item.Send(this);
     return true;
 }
Example #8
0
 public void Unequip(ConquerItem Item, ItemPosition Position)
 {
     Item.Position = Position;
     Item.Unequip(this);
     Equipment.ThreadSafeRemove(Position);
 }
Example #9
0
 public bool TryGetInventory(uint UID, out ConquerItem Item)
 {
     Item = default(ConquerItem);
     lock (Inventory)
     {
         Item = Inventory.Find((item) => { return item.UID == UID; });
         if (Item != null)
             return true;
     }
     return false;
 }
Example #10
0
 public bool TryGetEquipment(ItemPosition Position, out ConquerItem Item)
 {
     Item = default(ConquerItem);
     if (Equipment.ContainsKey(Position))
     {
         Item = Equipment[Position];
         return true;
     }
     return false;
 }
Example #11
0
        public bool RemoveInventory(ConquerItem Item)
        {
            bool Removed = false;
            lock (Inventory)
            {
                Removed = Inventory.Remove(Item);
                if (Removed)
                {
                    Item.RemoveInventory(this);
                }

            }
            return Removed;
        }
Example #12
0
 public bool AddInventory(ConquerItem Item)
 {
     lock (Inventory)
     {
         if (Inventory.Count < 40)
         {
             Item.Position = ItemPosition.Inventory;
             Item.Send(this);
             Inventory.Add(Item);
             return true;
         }
         return false;
     }
 }