public void buy(Weapon w) { Console.WriteLine(w.weaponName + " bought..."); bp.addWeapon(w); //backpack[numItems] = w; numItems++; Console.Write(numItems); }
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"); } }
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"); } }
public void buy(Weapon w) { Console.WriteLine(w.weaponName + " bought..."); backpack.addWeapon(w); Console.Write(backpack.presentWeight); }