LinkedList/Hero.java
Sobottasgithub 74e46e60c7 update: fix
2026-01-14 07:04:38 +01:00

32 lines
760 B
Java

public class Hero {
private String name;
private int strength;
private LinkedList weaponInventory;
private Weapon currentWeapon;
public Hero(String name, int strength) {
this.name = name;
this.strength = strength;
}
public LinkedList getWeaponInventory() {
return weaponInventory;
}
/*
public void addWeapon(Weapon weapon) {
weaponInventory.append(weapon);
}
public void chooseWeapon(weapon) {
weaponInventory.toFirst();
while(weaponInventory.hasAccess() && weaponInventory.getCurrentContent() != weapon) {
weaponInventory.toNext();
}
if (weaponInventory.hasAccess()) {
System.out.println("Weapon was chosen");
//currentWeapon = weaponInventory.getCurrentContent();
}
}
*/
}