Skip to content

TriggerCeLock

Classes

TriggerCELock

Object used to identify which conditions and effects should be locked from change

Source code in AoE2ScenarioParser/objects/support/trigger_ce_lock.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
class TriggerCELock:
    """Object used to identify which conditions and effects should be locked from change"""
    def __init__(
            self,
            lock_conditions: bool = False,
            lock_effects: bool = False,
            lock_condition_type: List[int] | None = None,
            lock_effect_type: List[int] | None = None,
            lock_condition_ids: List[int] | None = None,
            lock_effect_ids: List[int] | None = None
    ):
        """
        Args:
            lock_conditions: Lock all conditions
            lock_effects: Lock all effects
            lock_condition_type: Lock certain condition types. Example: `ConditionId.OWN_OBJECTS`
            lock_effect_type: Lock certain effect types. Example: `EffectId.CREATE_OBJECT`
            lock_condition_ids: Lock certain conditions by their id
            lock_effect_ids: Lock certain effects by their id
        """
        if lock_condition_type is None:
            lock_condition_type = []
        if lock_effect_type is None:
            lock_effect_type = []
        if lock_condition_ids is None:
            lock_condition_ids = []
        if lock_effect_ids is None:
            lock_effect_ids = []

        self.lock_conditions = lock_conditions
        self.lock_effects = lock_effects
        self.lock_condition_type = lock_condition_type
        self.lock_effect_type = lock_effect_type
        self.lock_condition_ids = lock_condition_ids
        self.lock_effect_ids = lock_effect_ids

Attributes

Attribute Type
lock_condition_ids instance-attribute
lock_condition_type instance-attribute
lock_conditions instance-attribute
lock_effect_ids instance-attribute
lock_effect_type instance-attribute
lock_effects instance-attribute

Functions


def __init__(...)

Parameters:

Name Type Description Default
lock_conditions bool

Lock all conditions

False
lock_effects bool

Lock all effects

False
lock_condition_type List[int] | None

Lock certain condition types. Example: ConditionId.OWN_OBJECTS

None
lock_effect_type List[int] | None

Lock certain effect types. Example: EffectId.CREATE_OBJECT

None
lock_condition_ids List[int] | None

Lock certain conditions by their id

None
lock_effect_ids List[int] | None

Lock certain effects by their id

None
Source code in AoE2ScenarioParser/objects/support/trigger_ce_lock.py
 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
def __init__(
        self,
        lock_conditions: bool = False,
        lock_effects: bool = False,
        lock_condition_type: List[int] | None = None,
        lock_effect_type: List[int] | None = None,
        lock_condition_ids: List[int] | None = None,
        lock_effect_ids: List[int] | None = None
):
    """
    Args:
        lock_conditions: Lock all conditions
        lock_effects: Lock all effects
        lock_condition_type: Lock certain condition types. Example: `ConditionId.OWN_OBJECTS`
        lock_effect_type: Lock certain effect types. Example: `EffectId.CREATE_OBJECT`
        lock_condition_ids: Lock certain conditions by their id
        lock_effect_ids: Lock certain effects by their id
    """
    if lock_condition_type is None:
        lock_condition_type = []
    if lock_effect_type is None:
        lock_effect_type = []
    if lock_condition_ids is None:
        lock_condition_ids = []
    if lock_effect_ids is None:
        lock_effect_ids = []

    self.lock_conditions = lock_conditions
    self.lock_effects = lock_effects
    self.lock_condition_type = lock_condition_type
    self.lock_effect_type = lock_effect_type
    self.lock_condition_ids = lock_condition_ids
    self.lock_effect_ids = lock_effect_ids