public boolean equipWeapon(Weapon w) { if (realSlot == 0) { return false; } else { w.setIsEquipped(true); weaponList.add(w); realCapacity -= w.getWeight(); realSlot -= 1; return true; } }
public boolean removeWeapon(int n) { if (n > weaponList.size() || n == 0) { return false; } else { realCapacity += weaponList.get(n - 1).getWeight(); Weapon w = weaponList.get(n - 1); w.setIsEquipped(false); weaponList.remove(n - 1); realSlot += 1; return true; } }