public void enterCommand(String command, Player player) {
        try {
            String[] commandString = command.split(" ");
            if (SubCommand.isHelpCommand(commandString[0]) || commandString[0].equals("")) {
                help(commandString);
            } else if (SubCommand.isBackCommand(commandString[0])) {
                displayDefault(player);
            }
            else {
                switch (state) {
                case NEWGAME:
                    if (SubCommand.isYesCommand(commandString[0])) {
                        rebootGame();
                    }
                    break;
                case BATTLE:
                    executeBattleCommand(commandString, player);
                    break;
                case DOCKED:
                    executeDockCommand(commandString, player);
                    break;
                case DEFAULT:
                    executePrimaryCommand(commandString, player);
                    break;
                }
            }
        } catch (CommandException e) {
            gui.displayError(e.getMessage());
        }
    }