return this.inventory.addItem(item);
}
public boolean equip(Equipment equipment) {
Equipment removedEquipment = this.equipment.equip(equipment);
// Add defense bonus of new armor
if(equipment.isArmor()) {
this.increaseDefense(((Armor)equipment).getDefense());
}
if(removedEquipment == null) {
return true;
}
// Decrease defense bonus of removed armor
if(removedEquipment.isArmor()) {
this.decreaseDefense(((Armor)removedEquipment).getDefense());
}
//TODO: Fix this. We can lose an item if it fails to add to inventory.
return this.addToInventory(removedEquipment);
}