Instruction ← you are here ├── PlayerInstruction └── EnemyInstruction

Serialized Fields

FieldTypeRangeDescription
_directionDirectionUp / Down / Left / RightThe direction this instruction acts in. Access via the direction property.
_loopint1 – 12How many times this instruction repeats. Access via the loop property.

Properties

PropertyTypeDescription
displayName abstractstringLabel shown in the instruction sheet UI. Must be overridden in every subclass.
directionDirectionCurrent direction. Set via SetDirection().
loopintCurrent repetition count (1–12).
contextExecutionContextInjected by Run() before Tick() is called. Read only.
resolution virtualboolTrue by default. Set to false inside Tick() then yield break to stop the runner.

Events

EventSignatureWhen
OnInstructionStartActionFired at the start of Run(), before Tick().
OnInstructionEndActionFired after Tick() completes.

Abstract Methods — Must Override

MethodReturnsDescription
Execute()voidInstant synchronous side-effects before animation — deal damage, spawn a prefab, change state. Called by the runner via animation events. Can be left empty.
Tick(ExecutionContext ctx)IEnumeratorThe coroutine driving animation and logic. Yield to wait. To fail: set resolution = false then yield break.

Virtual Methods — Optional Override

MethodDefaultWhen to override
Validate()Returns trueReturn false to block execution before the turn begins and show an error notification.
GetExecutionList(int loop)Yields this onceOverride in sequences and modifiers that expand into multiple execution steps.
SetDirection(Direction d)Sets this.directionOverride in modifiers to also sync the child instruction's direction.

Utility Methods

MethodDescription
IncreaseLoop()Increments loop count by 1 (max 12). Called from the instruction sheet UI.
DecreaseLoop()Decrements loop count by 1 (min 1). Called from the instruction sheet UI.
SetLoop(int n)Sets loop count directly.
Clone()Returns a deep copy via serialize/deserialize round-trip. Used by the runner before each execution.
Serialize()Returns a SerializedInstruction for JSON storage.