Esempio n. 1
0
 public void ThrowItemToBag(Item item, Backpack Bag, Coordinates target, UI SourceEquipment = null, Backpack Parent = null)
 {
     if (Parent != null)
     {
         Parent.RemoveItem(item);
     }
     item.Slot = null;
     item.Position = new Coordinates(target.X, target.Y);
     Bag.AddItem(item);
     if (SourceEquipment != null)
     {
         Players[0].UnequipItem(SourceEquipment.Name);
     }
 }
Esempio n. 2
0
 internal void ThrowItemToBag(Item item, Backpack Bag, Coordinates target, UI SourceEquipment = null, Backpack Parent = null)
 {
     if (Parent != null)
     {
         Parent.RemoveItem(item);
         item.Slot = null;
         item.WearingPlayerID = Players[0].ID;
         item.Position = new Coordinates(target.X, target.Y);
         Bag.AddItem(item);
         if (SourceEquipment != null)
         {
             Players[0].UnequipItem(SourceEquipment.Name);
         }
     }
     else
     {
         if (SourceEquipment != null)
         {
             item.Slot = null;
             item.WearingPlayerID = Players[0].ID;
             item.Position = new Coordinates(target.X, target.Y);
             Bag.AddItem(item);
             Players[0].UnequipItem(SourceEquipment.Name);
         }
         else
         {
             if (AdjacentToItem(Players[0], item))
             {
                 item.Slot = null;
                 item.WearingPlayerID = Players[0].ID;
                 item.Position = new Coordinates(target.X, target.Y);
                 Bag.AddItem(item);
             }
         }
     }
 }