示例#1
0
 public void remove(String item) {
   for (Item i : inventory) {
     if (i.getName() == item) {
       inventory.remove(i);
       System.out.println("Item " + item + " removed from inventory.");
     }
   }
 }
示例#2
0
 public void add(Item i) {
   System.out.println(Player.getPlayer().getName() + " has picked up: " + i.getName() + ".");
   inventory.add(i);
 }