Skip to content

InstructionSet Class

A set of instructions to be executed sequentially.

C#
public class InstructionSet : InstructionBase, IComponent

Inheritance objectUpdateComponentInstructionBase

Implements IComponent

C#
public InstructionSet()

All instructions in this set.

C#
public LinkedList<InstructionBase> Instructions { get; }

The name of this instruction to identify it apart from other instruction sets.

C#
public string Name { get; set; }

Represents the current instruction if this set is currently executing.

C#
public InstructionBase? CurrentInstruction { get; }

Resets the Done flag.

C#
public override void Reset()

On the base class, resets the IsFinished to false. Override this method to reset the derived class’ counters and status flags for the instruction.

Runs the instruction set. Once all instructions are finished, this set will set the IsFinished property will be set to true.

C#
public override void Update(IScreenObject componentHost, TimeSpan delta)

componentHost IScreenObject

delta TimeSpan

Adds a new Wait instruction with the specified duration to the end of this set.

C#
public InstructionSet Wait(TimeSpan duration)

duration TimeSpan
The time to wait.

InstructionSet
This instruction set.

Adds an instruction to the end of this set.

C#
public InstructionSet Instruct(InstructionBase instruction)

instruction InstructionBase

InstructionSet
This instruction set.

Adds a new CodeInstruction instruction with the specified callback to the end of this set.

C#
public InstructionSet Code(Func<IScreenObject, TimeSpan, bool> expression)

expression Func<IScreenObject, TimeSpan, bool>
The code callback.

InstructionSet
This instruction set.

Adds a new CodeInstruction instruction with the specified callback to the end of this set.

C#
public InstructionSet Code(Action expression)

expression Action
The code callback.

InstructionSet
This instruction set.

Adds a new PredicateInstruction instruction with the specified callback to the end of this set.

C#
public InstructionSet WaitTrue(Func<bool> expression)

expression Func<bool>
The code callback.

InstructionSet
This instruction set.

InstructConcurrent(params InstructionBase[])

Section titled “InstructConcurrent(params InstructionBase[])”

Adds a ConcurrentInstructions to the end of this set.

C#
public InstructionSet InstructConcurrent(params InstructionBase[] instructions)

instructions InstructionBase[]
Instructions to add. Must be two or more instructions.

InstructionSet
This instruction set.