Skip to content

AlterantEngine

Divided by Zer0 edited this page Mar 9, 2022 · 7 revisions

AlterantEngine

Extends: Reference

Description

This class contains all the functionality required to modify a running task during runtime

The automation is based on ScriptAlter definitions.

This class is on request when one of a number of specific tasks which allow it, are going through all the cards, looking for valid Alterants definitions.

Property Descriptions

all_alterations_completed

var all_alterations_completed: bool

This is checked by the yield in get_altered_value to know execution has completed.

alteration

var alteration: int

This is checked by the yield in get_altered_value to know execution has completed. The total amount of alterations that this card's script will perform.

Method Descriptions

_init

func _init(trigger_object: Card, alterant_object, scripts_queue: Array, task_details: Dictionary) -> void

Sets the owner of this Scripting Engine

calculate_next_alteration

func calculate_next_alteration(trigger_object: Card, alterant_object, scripts_queue: Array, task_details: Dictionary) -> var

The main engine starts here. It receives array with all the possible alterations to execute, then turns each array element into a ScriptAlter object which check against the relevant filters and per_ requests.

calculate_alteration

func calculate_alteration(script: ScriptAlter) -> void

This is called if the alterants passes all validity checks it calculates how much to alter, based on the script definition.

Signals

  • signal alterations_completed(): Emitted when all alterations have been run succesfully