synonyms, and take all command

This commit is contained in:
jslightham
2019-05-29 10:56:22 -04:00
parent 2d40e5954a
commit bad3490b1e
6 changed files with 90 additions and 6 deletions

View File

@@ -16,6 +16,7 @@ public class Player extends Entity{
public boolean addToInventory(Item item){
if(currentInventoryWeight + item.getWeight() < INVENTORY_CAPACITY){
currentInventoryWeight+= item.getWeight();
inventory.add(item);
return true;
}
@@ -26,6 +27,7 @@ public class Player extends Entity{
for(int i =0; i<inventory.size(); i++) {
if(item.equals(inventory.get(i))) {
inventory.remove(i);
currentInventoryWeight-= item.getWeight();
return;
}
}