private void useItem() { Game game = PemberleyGame.getCurrentGame(); ItemControl itemControl = new ItemControl(); String prompt = "What do you want to try and use?"; // check to see if there is anything to use. if (game.getLocalItemNames().length == 0 && game.getInventoryItemNames().length == 0) { this.console.println("There is nothing to use here."); return; } this.console.println("These things are accessible:\n"); for (String i : game.getLocalItemNames()) { this.console.print(i + "\n"); } for (String i : game.getInventoryItemNames()) { this.console.print(i + "\n"); } String playerSelection; do { playerSelection = this.getStringInput(prompt); String useItemMessage = itemControl.useItem(playerSelection, game); this.console.println(useItemMessage); } while (!playerSelection.equalsIgnoreCase("x")); }