diff --git a/src/main/java/org/bitbiome/Boot.java b/src/main/java/org/bitbiome/Boot.java new file mode 100644 index 0000000..590ef38 --- /dev/null +++ b/src/main/java/org/bitbiome/Boot.java @@ -0,0 +1,23 @@ +package org.bitbiome; + +import org.bitbiome.commands.CommandListener; + +public class Boot { + + private CommandListener cmdListener; + public static Boot instance; + public Boot() { + instance = this; + cmdListener = new CommandListener(); + InteractionLoop game = new InteractionLoop(); + game.run(); + } + + public CommandListener getCmdListener(){ + return cmdListener; + } + +} + + + diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java new file mode 100644 index 0000000..9ed47ee --- /dev/null +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -0,0 +1,38 @@ +package org.bitbiome.commands; + +import java.util.HashMap; +import java.util.Scanner; + +public class CommandListener { + + private HashMap commands; + + public CommandListener() { + commands = new HashMap<>(); + + /* + * Commandfield + * + * commands.put("CommandName", new CommandClass()); + * + * + */ + } + + public HashMap returnCommands() { + return commands; + } + + + public boolean perform(String command, Scanner scanner, boolean isRunning, String message) { + + CommandAPI cmd; + if ((cmd = commands.get(command)) != null) { + cmd.performCommand(scanner, isRunning, message); + return true; + } + return false; + } + + +}