Пример #1
0
 public virtual void AddItem(PlayerItem Item)
 {
     if (Item is Weapon)
     {
         Weapon Weapon = (Weapon)Item;
         if (weapons.Count == 5)
         {
             MessageBox.Show("You cannot exceed 5 weapons!");
         }
         else
         {
             weapons.Add(Weapon);
             itemList.Add(Weapon);
         }
     }
     else if (Item is AmmoPack)
     {
         AmmoPack pack = (AmmoPack)Item;
         DetermineAmmoPackType(pack);
         itemList.Add(pack);
     }
 }
Пример #2
0
 public void addToInv(PlayerItem item)
 {
     this.itemList.Add(item);
 }
Пример #3
0
 public void remove(PlayerItem item)
 {
     this.itemList.Remove(item);
 }