@Override
    public CommandResponse doHandle(Command command) {
        DiceSet diceSet = gameState.getDiceSet();

        if (command == GameCommand.TERMINATE) {
            running = false;
        }
        else if(command == GameCommand.REROLL) {
            if (currentRerolls < getMaxRerolls()) {
                diceSet.roll();
                ++currentRerolls;
            }
            else {
                return CommandResponses.COMMAND_FAILED;
            }
        }
        else if(command.getCommandString().equals("l") && (command instanceof ValueGameCommand)) {
            int i = ((ValueGameCommand<Integer>) command).getValue();
            if (0 <= i && i < diceSet.SIZE) {
                if (diceSet.isLocked(i)) {
                    diceSet.unlock(i);
                }
                else {
                    diceSet.lock(i);
                }
            }
            else
                return CommandResponses.COMMAND_FAILED;
        }

        return testHandle(command);
    }