Browse Source

refactor: Edited help command

Prepared for unit test, output message is now hardcoded
remotes/origin/locations
David Hermann 2 years ago
parent
commit
5a35f0ee84
  1. 13
      src/main/java/org/bitbiome/commands/HelpCommand.java

13
src/main/java/org/bitbiome/commands/HelpCommand.java

@ -10,13 +10,14 @@ public class HelpCommand implements CommandAPI {
@Override
public void performCommand(Scanner scanner, boolean isRunning, String message) {
HashMap<String, CommandAPI> commands = Boot.instance.getCmdListener().returnCommands();
System.out.println(getHelpMessage());
}
public static String getHelpMessage() {
StringBuilder outputMessage = new StringBuilder();
outputMessage.append("Hier ist eine Liste der Commands:\n");
commands.forEach((key, value) -> {
outputMessage.append("- ").append(key).append("\n");
});
System.out.println(outputMessage.toString());
outputMessage.append("Hier ist eine Liste der Commands:\n").append("- help -> Gibt diese Nachricht aus\n").append("- exit/quit -> Beendet das Spiel\n");
return outputMessage.toString();
}
}
Loading…
Cancel
Save