Module server.games.typedefs

Classes

class BasicGameInfo (game_id: int,
rating_type: str | None,
map_id: int | None,
game_mode: str,
mods: list[str],
teams: list[set[Player]])
Expand source code
class BasicGameInfo(NamedTuple):
    """
    Holds basic information about a game that does not change after launch.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    teams: list[set[Player]]

Holds basic information about a game that does not change after launch. Fields: - game_id: id of the game - rating_type: str (e.g. "ladder1v1") - map_id: id of the map used - game_mode: name of the featured mod

Ancestors

  • builtins.tuple

Instance variables

var game_id : int
Expand source code
class BasicGameInfo(NamedTuple):
    """
    Holds basic information about a game that does not change after launch.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    teams: list[set[Player]]

Alias for field number 0

var game_mode : str
Expand source code
class BasicGameInfo(NamedTuple):
    """
    Holds basic information about a game that does not change after launch.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    teams: list[set[Player]]

Alias for field number 3

var map_id : int | None
Expand source code
class BasicGameInfo(NamedTuple):
    """
    Holds basic information about a game that does not change after launch.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    teams: list[set[Player]]

Alias for field number 2

var mods : list[str]
Expand source code
class BasicGameInfo(NamedTuple):
    """
    Holds basic information about a game that does not change after launch.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    teams: list[set[Player]]

Alias for field number 4

var rating_type : str | None
Expand source code
class BasicGameInfo(NamedTuple):
    """
    Holds basic information about a game that does not change after launch.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    teams: list[set[Player]]

Alias for field number 1

var teams : list[set[Player]]
Expand source code
class BasicGameInfo(NamedTuple):
    """
    Holds basic information about a game that does not change after launch.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    teams: list[set[Player]]

Alias for field number 5

class EndedGameInfo (game_id: int,
rating_type: str | None,
map_id: int | None,
game_mode: str,
mods: list[str],
commander_kills: dict[str, int],
validity: ValidityState,
team_summaries: list[TeamRatingSummary])
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Holds the outcome of an ended game. Fields: - game_id: id of the game - rating_type: str (e.g. "ladder1v1") - map_id: id of the map used - game_mode: name of the featured mod - validity: ValidityState (e.g. VALID or TOO_SHORT) - team_summaries: a list of TeamRatingSummaries containing IDs of players on the team and the team's outcome

Ancestors

  • builtins.tuple

Static methods

def from_basic(basic_info: BasicGameInfo,
validity: ValidityState,
team_outcomes: list[GameOutcome],
commander_kills: dict[str, int],
team_army_results: list[list[ArmyResult]]) ‑> EndedGameInfo

Instance variables

var commander_kills : dict[str, int]
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 5

var game_id : int
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 0

var game_mode : str
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 3

var map_id : int | None
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 2

var mods : list[str]
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 4

var rating_type : str | None
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 1

var team_summaries : list[TeamRatingSummary]
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 7

var validityValidityState
Expand source code
class EndedGameInfo(NamedTuple):
    """
    Holds the outcome of an ended game.
    Fields:
     - game_id: id of the game
     - rating_type: str (e.g. "ladder1v1")
     - map_id: id of the map used
     - game_mode: name of the featured mod
     - validity: ValidityState (e.g. VALID or TOO_SHORT)
     - team_summaries: a list of TeamRatingSummaries containing IDs of players
       on the team and the team's outcome
    """

    game_id: int
    rating_type: Optional[str]
    map_id: Optional[int]
    game_mode: str
    mods: list[str]
    commander_kills: dict[str, int]
    validity: ValidityState
    team_summaries: list[TeamRatingSummary]

    @classmethod
    def from_basic(
        cls,
        basic_info: BasicGameInfo,
        validity: ValidityState,
        team_outcomes: list[GameOutcome],
        commander_kills: dict[str, int],
        team_army_results: list[list[ArmyResult]],
    ) -> "EndedGameInfo":
        if len(basic_info.teams) != len(team_outcomes):
            raise ValueError(
                "Team sets of basic_info and team outcomes must refer to the "
                "same number of teams in the same order."
            )

        return cls(
            basic_info.game_id,
            basic_info.rating_type,
            basic_info.map_id,
            basic_info.game_mode,
            basic_info.mods,
            commander_kills,
            validity,
            [
                TeamRatingSummary(outcome, set(player.id for player in team), army_results)
                for outcome, team, army_results
                in zip(team_outcomes, basic_info.teams, team_army_results)
            ],
        )

    def to_dict(self):
        return {
            "game_id": self.game_id,
            "rating_type": self.rating_type
            if self.rating_type is not None
            else "None",
            "map_id": self.map_id,
            "featured_mod": self.game_mode,
            "sim_mod_ids": self.mods,
            "commander_kills": self.commander_kills,
            "validity": self.validity.name,
            "teams": [
                {
                    "outcome": team_summary.outcome.name,
                    "player_ids": list(team_summary.player_ids),
                    "army_results": [
                        result._asdict()
                        for result in sorted(
                            team_summary.army_results,
                            key=lambda x: x.player_id
                        )
                    ],
                }
                for team_summary in self.team_summaries
            ],
        }

Alias for field number 6

Methods

def to_dict(self)
Expand source code
def to_dict(self):
    return {
        "game_id": self.game_id,
        "rating_type": self.rating_type
        if self.rating_type is not None
        else "None",
        "map_id": self.map_id,
        "featured_mod": self.game_mode,
        "sim_mod_ids": self.mods,
        "commander_kills": self.commander_kills,
        "validity": self.validity.name,
        "teams": [
            {
                "outcome": team_summary.outcome.name,
                "player_ids": list(team_summary.player_ids),
                "army_results": [
                    result._asdict()
                    for result in sorted(
                        team_summary.army_results,
                        key=lambda x: x.player_id
                    )
                ],
            }
            for team_summary in self.team_summaries
        ],
    }
class FA
Expand source code
class FA(object):
    __slots__ = ()

    ENABLED = _FAEnabled()
    DISABLED = _FADisabled()

Class variables

var DISABLED

The type of the None singleton.

var ENABLED

The type of the None singleton.

class FeaturedModType
Expand source code
class FeaturedModType():
    """
    String constants for featured mod technical_name
    """

    COOP = "coop"
    FAF = "faf"
    FAFBETA = "fafbeta"
    LADDER_1V1 = "ladder1v1"

String constants for featured mod technical_name

Class variables

var COOP

The type of the None singleton.

var FAF

The type of the None singleton.

var FAFBETA

The type of the None singleton.

var LADDER_1V1

The type of the None singleton.

class GameConnectionState (*args, **kwds)
Expand source code
@unique
class GameConnectionState(Enum):
    INITIALIZING = 0
    INITIALIZED = 1
    CONNECTED_TO_HOST = 2
    ENDED = 3

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var CONNECTED_TO_HOST

The type of the None singleton.

var ENDED

The type of the None singleton.

var INITIALIZED

The type of the None singleton.

var INITIALIZING

The type of the None singleton.

class GameState (*args, **kwds)
Expand source code
@unique
class GameState(Enum):
    INITIALIZING = 0
    LOBBY = 1
    LIVE = 2
    ENDED = 3

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var ENDED

The type of the None singleton.

var INITIALIZING

The type of the None singleton.

var LIVE

The type of the None singleton.

var LOBBY

The type of the None singleton.

class GameType (*args, **kwds)
Expand source code
@unique
class GameType(Enum):
    COOP = "coop"
    CUSTOM = "custom"
    MATCHMAKER = "matchmaker"

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var COOP

The type of the None singleton.

var CUSTOM

The type of the None singleton.

var MATCHMAKER

The type of the None singleton.

class InitMode (*args, **kwds)
Expand source code
@unique
class InitMode(Enum):
    NORMAL_LOBBY = 0
    AUTO_LOBBY = 1

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var AUTO_LOBBY

The type of the None singleton.

var NORMAL_LOBBY

The type of the None singleton.

class TeamRatingSummary (outcome: GameOutcome,
player_ids: set[int],
army_results: list[ArmyResult])
Expand source code
class TeamRatingSummary(NamedTuple):
    outcome: GameOutcome
    player_ids: set[int]
    army_results: list[ArmyResult]

TeamRatingSummary(outcome, player_ids, army_results)

Ancestors

  • builtins.tuple

Instance variables

var army_results : list[ArmyResult]
Expand source code
class TeamRatingSummary(NamedTuple):
    outcome: GameOutcome
    player_ids: set[int]
    army_results: list[ArmyResult]

Alias for field number 2

var outcomeGameOutcome
Expand source code
class TeamRatingSummary(NamedTuple):
    outcome: GameOutcome
    player_ids: set[int]
    army_results: list[ArmyResult]

Alias for field number 0

var player_ids : set[int]
Expand source code
class TeamRatingSummary(NamedTuple):
    outcome: GameOutcome
    player_ids: set[int]
    army_results: list[ArmyResult]

Alias for field number 1

class ValidityState (*args, **kwds)
Expand source code
@unique
class ValidityState(Enum):
    VALID = 0
    TOO_MANY_DESYNCS = 1
    WRONG_VICTORY_CONDITION = 2
    NO_FOG_OF_WAR = 3
    CHEATS_ENABLED = 4
    PREBUILT_ENABLED = 5
    NORUSH_ENABLED = 6
    BAD_UNIT_RESTRICTIONS = 7
    BAD_MAP = 8
    TOO_SHORT = 9
    BAD_MOD = 10
    COOP_NOT_RANKED = 11
    MUTUAL_DRAW = 12
    SINGLE_PLAYER = 13
    FFA_NOT_RANKED = 14
    UNEVEN_TEAMS_NOT_RANKED = 15
    UNKNOWN_RESULT = 16
    UNLOCKED_TEAMS = 17
    MULTI_TEAM = 18
    HAS_AI_PLAYERS = 19
    CIVILIANS_REVEALED = 20
    WRONG_DIFFICULTY = 21
    EXPANSION_DISABLED = 22
    SPAWN_NOT_FIXED = 23
    OTHER_UNRANK = 24
    HOST_SET_UNRANKED = 25

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var BAD_MAP

The type of the None singleton.

var BAD_MOD

The type of the None singleton.

var BAD_UNIT_RESTRICTIONS

The type of the None singleton.

var CHEATS_ENABLED

The type of the None singleton.

var CIVILIANS_REVEALED

The type of the None singleton.

var COOP_NOT_RANKED

The type of the None singleton.

var EXPANSION_DISABLED

The type of the None singleton.

var FFA_NOT_RANKED

The type of the None singleton.

var HAS_AI_PLAYERS

The type of the None singleton.

var HOST_SET_UNRANKED

The type of the None singleton.

var MULTI_TEAM

The type of the None singleton.

var MUTUAL_DRAW

The type of the None singleton.

var NORUSH_ENABLED

The type of the None singleton.

var NO_FOG_OF_WAR

The type of the None singleton.

var OTHER_UNRANK

The type of the None singleton.

var PREBUILT_ENABLED

The type of the None singleton.

var SINGLE_PLAYER

The type of the None singleton.

var SPAWN_NOT_FIXED

The type of the None singleton.

var TOO_MANY_DESYNCS

The type of the None singleton.

var TOO_SHORT

The type of the None singleton.

var UNEVEN_TEAMS_NOT_RANKED

The type of the None singleton.

var UNKNOWN_RESULT

The type of the None singleton.

var UNLOCKED_TEAMS

The type of the None singleton.

var VALID

The type of the None singleton.

var WRONG_DIFFICULTY

The type of the None singleton.

var WRONG_VICTORY_CONDITION

The type of the None singleton.

class Victory (*args, **kwds)
Expand source code
@unique
class Victory(Enum):
    DEMORALIZATION = "DEMORALIZATION"
    DOMINATION = "DOMINATION"
    ERADICATION = "ERADICATION"
    SANDBOX = "SANDBOX"
    DECAPITATION = "DECAPITATION"

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var DECAPITATION

The type of the None singleton.

var DEMORALIZATION

The type of the None singleton.

var DOMINATION

The type of the None singleton.

var ERADICATION

The type of the None singleton.

var SANDBOX

The type of the None singleton.

class VisibilityState (*args, **kwds)
Expand source code
@unique
class VisibilityState(Enum):
    PUBLIC = "public"
    FRIENDS = "friends"

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var FRIENDS

The type of the None singleton.

var PUBLIC

The type of the None singleton.