Example #1
0
 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);
 }
Example #2
0
 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);
     }
 }
Example #3
0
 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);
 }