def _check_direction(self, action, state):
    """Compare (and update) controller's direction with the current direction.

    Args:
      action: Action to check
      state: Current state of the action being checked
    """
    assert isinstance(action, football_action_set.CoreAction)
    if not action.is_in_actionset(self._env_config):
      return
    if self._current_direction != football_action_set.action_idle:
      return
    if state:
      self._current_direction = action
Compare (and update) controller's direction with the current direction.

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