def step(
      self,
      *,
      active_players: Sequence[agent_lib.GenerativeAgent] | None = None,
      action_spec_override: (
          agent_lib.ActionSpec | Mapping[str, agent_lib.ActionSpec] | None
      ) = None,
  ) -> None:
    """Steps the game.

    At each step players all take a turn 'quasisimultaneously' with regard to
    the main game clock, but still in a specific order within the timestep.
    This is the same principle as initiative order in dungeons and dragons.

    Args:
      active_players: Optionally specify players to take turns in this round.
      action_spec_override: Optionally override what kind of actions to ask the
        agents to generate.
    """
    if active_players:
      players = list(active_players)
    else:
      players = list(self._players_by_name.values())
    if self._randomise_initiative:
      self._rng.shuffle(players)

    if action_spec_override is None:
      action_spec = self._action_spec
    elif isinstance(action_spec_override, Mapping):
      action_spec = self._action_spec | action_spec_override
    elif isinstance(action_spec_override, agent_lib.ActionSpec):
      action_spec = {player.name: action_spec_override for player in players}
    else:
      raise TypeError('Invalid action_spec parameter type')

    for player in players:
      self._step_player(player, action_spec=action_spec[player.name])
      if not self._players_act_simultaneously:
        self._clock.advance()
    if self._players_act_simultaneously:
      self._clock.advance()
Steps the game.

    At each step players all take a turn 'quasisimultaneously' with regard to
    the main game clock, but still in a specific order within the timestep.
    This is the same principle as initiative order in dungeons and dragons.

    Args:
      active_players: Optionally specify players to take turns in this round.
      action_spec_override: Optionally override what kind of actions to ask the
        agents to generate.
    
concordia/environment/deprecated/game_master.py