I've got this atm:
private Position[] pathto = {
new Position(3276, 3171, 0),new Position(3280, 3181, 0)
};
private Position[] pathback = {
new Position(3280, 3181, 0), new Position(3276, 3171, 0)
};
boolean gotOres() {
return getInventory().getAmount("Coal") >= 2 && getInventory().getAmount("Iron ore") >= 1;
}
boolean gotFurnace() {
return objects.closest("Furnace").isVisible();
}
boolean gotBankbooth() {
return objects.closest("Bank booth").isVisible();
}
private enum State {
SMITH, BANK, WALKTO, WALKBACK
};
private State getState() {
if (gotOres() == true && gotFurnace() == true){
return State.SMITH;
}
if(gotFurnace() == false && gotOres() == true ){
return State.WALKTO;
}
if(gotBankbooth() == false && gotOres() == false){
return State.WALKBACK;
}
return State.BANK;
}
This is not working because getstate needs a default so whats the best approach for this situation?
I've added the boolean variables. (thanks for that)