public void PickupItem(Objects obj) { // Add an if-statement here when you want to have a maximum number of items inventory.Add(obj.GetName(), obj); Console.WriteLine("Picked up a(n) {0}", obj.GetName()); obj.SetIsAcquirable(false); }
public void PickupItem(Objects obj) { // Add an if-statement here when you want to have a maximum number of items if (HasObject(obj.GetName())) { Console.WriteLine("You already carry the maximum amount of this item"); gold += 1; } else { inventory.Add(obj.GetName(), obj); obj.SetIsAcquirable(false); } }
public void PickupItem(Objects obj) { // Add an if-statement here when you want to have a maximum number of items inventory.Add(obj.GetName(), obj); obj.SetIsAcquirable(false); }