@Override
  public void actionPerformed(ActionEvent e) {
    String commandName = e.getActionCommand();
    switch (commandName) {
      case "UP":
      case "W":
        nextDirection = Direction.UP;
        break;

      case "DOWN":
      case "S":
        nextDirection = Direction.DOWN;
        break;

      case "LEFT":
      case "A":
        nextDirection = Direction.LEFT;
        break;

      case "RIGHT":
      case "D":
        nextDirection = Direction.RIGHT;
        break;

      default:
        break;
    }
  }