Esempio n. 1
0
 public void buy(Weapon w)
 {
     Console.WriteLine(w.weaponName + " bought...");
     bp.addWeapon(w);
     //backpack[numItems] = w;
     numItems++;
     Console.Write(numItems);
 }
Esempio n. 2
0
 public void buyWeapon(Weapon weapon)
 {
     if (inventoryFull(weapon))
     {
         backpack.addWeapon(weapon);
         weapon.quantity--;
         Console.WriteLine("\nSuccessfully bought the weapon {0} for {1} coins!!\n", weapon.name, weapon.cost);
     }
     else
     {
         Console.WriteLine("\nYou're going to exceed the weight limit, please discard an item before you add this one!\n");
     }
 }
Esempio n. 3
0
 public void buy(Weapon w)
 {
     if (backpack.addWeapon(w) == true)
     {
         Console.WriteLine(w.weaponName + " bought...\n");
         w.count--;
         numItems++;
         Console.Write(numItems);
     }
     else
     {
         Console.WriteLine("This item is too heavy to add to your bag");
     }
 }
Esempio n. 4
0
 public void buy(Weapon w)
 {
     Console.WriteLine(w.weaponName + " bought...");
     backpack.addWeapon(w);
     Console.Write(backpack.presentWeight);
 }