Skip to content

Variable

Classes

Variable

Bases: AoE2Object

Object for handling a variable.

Source code in AoE2ScenarioParser/objects/data_objects/variable.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Variable(AoE2Object):
    """Object for handling a variable."""

    _link_list = [
        RetrieverObjectLinkGroup("Triggers", "variable_data[__index__]", group=[
            RetrieverObjectLink("variable_id"),
            RetrieverObjectLink("name", link="variable_name"),
        ])
    ]

    def __init__(self, variable_id: int, name: str, **kwargs):
        self.variable_id = variable_id
        self.name = name

        super().__init__(**kwargs)

Attributes

name = name instance-attribute
Value: name
variable_id = variable_id instance-attribute
Value: variable_id

Functions


def __init__(...)

Parameters:

Name Type Description Default
variable_id int - required
name str - required
kwargs ? - {}
Source code in AoE2ScenarioParser/objects/data_objects/variable.py
18
19
20
21
22
def __init__(self, variable_id: int, name: str, **kwargs):
    self.variable_id = variable_id
    self.name = name

    super().__init__(**kwargs)