private void callItemMenu() { Output.getInstance().prompt("Would you like to use or equip an item? 1 for YES, 0 for NO."); int input = InputUtil.getInput(0, 1); if (input == 1) { printInventory(); pickItem(); } }
private void pickItem() { Output.getInstance() .prompt( "Enter a number corresponding to the item of your choosing, type -1 to pick nothing."); int itemPicked = InputUtil.getInput(-1, _inventory.size() - 1); if (itemPicked == -1) return; Item pick = _inventory.get(itemPicked); if (pick.isEquipable()) equipItem((Equipment) pick); else useConsumable((UsableItem) pick); }
private int callTargetMenu(Party enemies) { Output.getInstance().info("List of avaiblable targets:"); Output.getInstance().orderedList(enemies.getParty().toArray()); Output.getInstance().prompt("Enter a number corresponding to the target chosen"); return InputUtil.getInput(0, enemies.getParty().size() - 1); }
private int callAbilityMenu() { Output.getInstance().info("List of avaiblable abilities:"); Output.getInstance().orderedList(_abilities.toArray()); Output.getInstance().prompt("Enter a number corresponding to the ability chosen"); return InputUtil.getInput(0, _abilities.size() - 1); }