def get_env_action(self, left, right, top, bottom, active_actions):
    """For a given controller's state generate next environment action.

    Args:
      action: Action to check
      state: Current state of the action being checked
    """
    self._current_direction = football_action_set.action_idle
    self._check_direction(football_action_set.action_top_left, top and
                          left)
    self._check_direction(football_action_set.action_top_right, top and
                          right)
    self._check_direction(football_action_set.action_bottom_left,
                          bottom and left)
    self._check_direction(football_action_set.action_bottom_right,
                          bottom and right)
    if self._current_direction == football_action_set.action_idle:
      self._check_direction(football_action_set.action_right, right)
      self._check_direction(football_action_set.action_left, left)
      self._check_direction(football_action_set.action_top, top)
      self._check_direction(football_action_set.action_bottom, bottom)
    if self._current_direction != self._last_direction:
      self._last_direction = self._current_direction
      if self._current_direction == football_action_set.action_idle:
        return football_action_set.action_release_direction
      else:
        return self._current_direction
    self._last_action = football_action_set.action_idle
    self._check_action(football_action_set.action_long_pass,
                       active_actions)
    self._check_action(football_action_set.action_high_pass,
                       active_actions)
    self._check_action(football_action_set.action_short_pass,
                       active_actions)
    self._check_action(football_action_set.action_shot, active_actions)
    self._check_action(football_action_set.action_keeper_rush,
                       active_actions)
    self._check_action(football_action_set.action_sliding, active_actions)
    self._check_action(football_action_set.action_pressure,
                       active_actions)
    self._check_action(football_action_set.action_team_pressure,
                       active_actions)
    self._check_action(football_action_set.action_sprint, active_actions)
    self._check_action(football_action_set.action_dribble, active_actions)
    return self._last_action
For a given controller's state generate next environment action.

    Args:
      action: Action to check
      state: Current state of the action being checked
    
gfootball/env/controller_base.py