Skip to content

SecondaryGameMode

Bases: _DataSetIntFlags

This enum class provides the integer values for the different secondary game modes.

Examples

Source code in AoE2ScenarioParser/datasets/trigger_lists/secondary_game_mode.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class SecondaryGameMode(_DataSetIntFlags):
    """
    This enum class provides the integer values for the different secondary game modes.

    **Examples**





    """

    # todo: we can probably add this to the base dataset int flags class, I have an idea on how to generic-ify this
    #  method although idk if its actually good - Alian
    @staticmethod
    def combine(
            empire_wars: bool = False,
            sudden_death: bool = False,
            regicide: bool = False,
            king_of_the_hill: bool = False,
    ) -> SecondaryGameMode:
        """
        This method combines the given hero status flags into an integer value

        Args:
            empire_wars: If empire wars should be enabled
            sudden_death: If sudden death should be enabled
            regicide: If regicide should be enabled
            king_of_the_hill: If king of the hill should be enabled

        Returns:
            An integer combining all the different hero status flags into one value
        """
        total = 1 if empire_wars else 0
        total += 2 if sudden_death else 0
        total += 4 if regicide else 0
        total += 8 if king_of_the_hill else 0
        return SecondaryGameMode(total)

    NONE = 0
    EMPIRE_WARS = 1
    SUDDEN_DEATH = 2
    REGICIDE = 4
    KING_OF_THE_HILL = 8

Attributes

NONE = 0 class-attribute instance-attribute

Value: 0

EMPIRE_WARS = 1 class-attribute instance-attribute

Value: 1

SUDDEN_DEATH = 2 class-attribute instance-attribute

Value: 2

REGICIDE = 4 class-attribute instance-attribute

Value: 4

KING_OF_THE_HILL = 8 class-attribute instance-attribute

Value: 8

Functions


def combine(...) staticmethod

This method combines the given hero status flags into an integer value

Parameters:

Name Type Description Default
empire_wars bool

If empire wars should be enabled

False
sudden_death bool

If sudden death should be enabled

False
regicide bool

If regicide should be enabled

False
king_of_the_hill bool

If king of the hill should be enabled

False

Returns:

Type Description
SecondaryGameMode

An integer combining all the different hero status flags into one value

Source code in AoE2ScenarioParser/datasets/trigger_lists/secondary_game_mode.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@staticmethod
def combine(
        empire_wars: bool = False,
        sudden_death: bool = False,
        regicide: bool = False,
        king_of_the_hill: bool = False,
) -> SecondaryGameMode:
    """
    This method combines the given hero status flags into an integer value

    Args:
        empire_wars: If empire wars should be enabled
        sudden_death: If sudden death should be enabled
        regicide: If regicide should be enabled
        king_of_the_hill: If king of the hill should be enabled

    Returns:
        An integer combining all the different hero status flags into one value
    """
    total = 1 if empire_wars else 0
    total += 2 if sudden_death else 0
    total += 4 if regicide else 0
    total += 8 if king_of_the_hill else 0
    return SecondaryGameMode(total)