You could use a Map for this, however if you wanted to store more information, you would need something else.
Probably your best bet is to store the information in an enum, as below (I wrote the code in the reply box so apologies if I made any mistakes, fingers crossed they should be easy enough to correct!). I included an additional parameter, 'colour', which is just the colour of the axe. In practice this is useless, but I included it to illustrate how to add a second parameter.
public enum Axe {
BRONZE(1, Color.BROWN),
IRON(1, Color.DARK_GRAY),
RUNE(41, Color.CYAN); // Add all axes here
private final int levelRequirement;
private final Color colour;
Axe (int levelRequirement, Color colour) {
this.levelRequirement = levelRequirement;
this.colour = colour;
}
// Returns whether the current level is sufficient for the axe
public boolean hasRequiredLevel(int currentLevel) {
return currentLevel >= levelRequirement;
}
// Returns the associated level requirement
public int getRequiredLevel() {
return levelRequirement;
}
// Returns the colour of the axe
public Color getColour() {
return colour;
}
// Make it return a cleanly formatted String, e.g 'Rune'
public String getTier() {
String lower = super.toString().toLowerCase().replace("_", " ");
return Character.toUpperCase(lower.charAt(0)) + lower.substring(1, lower.length());
}
// Make it return a cleanly formatted String for whole axe, e.g 'Rune axe'
public String getName() {
return getTier() + "axe";
}
@Override
public String toString() {
return getName();
}
}
Usage:
Axe toUse = Arrays.stream(Axe.values()).filter(a -> a.hasLevelRequirement(getSkills().getStatic(Skill.WOODCUTTING))).reduce(Axe.BRONZE, (a, b) -> b);
It is untested but it should hopefully work !!
Good luck!
Apa