Esempio n. 1
0
    def get_effect(self,
                   effect_index: int = None,
                   display_index: int = None) -> EffectObject:
        helper.evaluate_index_params(effect_index, display_index, "effect")

        if effect_index is None:
            effect_index = self.effect_order[display_index]

        return self.effects[effect_index]
Esempio n. 2
0
    def get_condition(self,
                      condition_index: int = None,
                      display_index: int = None) -> ConditionObject:
        helper.evaluate_index_params(condition_index, display_index,
                                     "condition")

        if condition_index is None:
            condition_index = self.condition_order[display_index]

        return self.conditions[condition_index]
Esempio n. 3
0
    def remove_condition(self, condition_index: int = None, display_index: int = None, condition: EffectObject = None) \
            -> None:
        if condition is None:
            helper.evaluate_index_params(condition_index, display_index,
                                         "condition")
        else:
            condition_index = self.conditions.index(condition)

        if condition_index is None:
            condition_index = self.condition_order[display_index]
        else:
            display_index = self.condition_order.index(condition_index)

        del self.conditions[condition_index]
        del self.condition_order[display_index]

        self.condition_order = [
            x - 1 if x > condition_index else x for x in self.condition_order
        ]
Esempio n. 4
0
    def remove_effect(self,
                      effect_index: int = None,
                      display_index: int = None,
                      effect: EffectObject = None) -> None:
        if effect is None:
            helper.evaluate_index_params(effect_index, display_index, "effect")
        else:
            effect_index = self.effects.index(effect)

        if effect_index is None:
            effect_index = self.effect_order[display_index]
        else:
            display_index = self.effect_order.index(effect_index)

        del self.effects[effect_index]
        del self.effect_order[display_index]

        self.effect_order = [
            x - 1 if x > effect_index else x for x in self.effect_order
        ]