InstructionSet Class
Definition
Section titled “Definition”A set of instructions to be executed sequentially.
public class InstructionSet : InstructionBase, IComponentInheritance object → UpdateComponent → InstructionBase
Implements IComponent
Constructors
Section titled “Constructors”InstructionSet()
Section titled “InstructionSet()”public InstructionSet()Properties
Section titled “Properties”Instructions
Section titled “Instructions”All instructions in this set.
public LinkedList<InstructionBase> Instructions { get; }The name of this instruction to identify it apart from other instruction sets.
public string Name { get; set; }CurrentInstruction
Section titled “CurrentInstruction”Represents the current instruction if this set is currently executing.
public InstructionBase? CurrentInstruction { get; }Methods
Section titled “Methods”Reset()
Section titled “Reset()”Resets the Done flag.
public override void Reset()Remarks
Section titled “Remarks”On the base class, resets the IsFinished to false. Override this method to reset the derived class’ counters and status flags for the instruction.
Update(IScreenObject, TimeSpan)
Section titled “Update(IScreenObject, TimeSpan)”Runs the instruction set. Once all instructions are finished, this set will set the IsFinished property will be set to true.
public override void Update(IScreenObject componentHost, TimeSpan delta)Parameters
Section titled “Parameters”componentHost IScreenObject
delta TimeSpan
Wait(TimeSpan)
Section titled “Wait(TimeSpan)”Adds a new Wait instruction with the specified duration to the end of this set.
public InstructionSet Wait(TimeSpan duration)Parameters
Section titled “Parameters”duration TimeSpan
The time to wait.
Returns
Section titled “Returns”InstructionSet
This instruction set.
Instruct(InstructionBase)
Section titled “Instruct(InstructionBase)”Adds an instruction to the end of this set.
public InstructionSet Instruct(InstructionBase instruction)Parameters
Section titled “Parameters”instruction InstructionBase
Returns
Section titled “Returns”InstructionSet
This instruction set.
Code(Func<IScreenObject, TimeSpan, bool>)
Section titled “Code(Func<IScreenObject, TimeSpan, bool>)”Adds a new CodeInstruction instruction with the specified callback to the end of this set.
public InstructionSet Code(Func<IScreenObject, TimeSpan, bool> expression)Parameters
Section titled “Parameters”expression Func<IScreenObject, TimeSpan, bool>
The code callback.
Returns
Section titled “Returns”InstructionSet
This instruction set.
Code(Action)
Section titled “Code(Action)”Adds a new CodeInstruction instruction with the specified callback to the end of this set.
public InstructionSet Code(Action expression)Parameters
Section titled “Parameters”expression Action
The code callback.
Returns
Section titled “Returns”InstructionSet
This instruction set.
WaitTrue(Func<bool>)
Section titled “WaitTrue(Func<bool>)”Adds a new PredicateInstruction instruction with the specified callback to the end of this set.
public InstructionSet WaitTrue(Func<bool> expression)Parameters
Section titled “Parameters”expression Func<bool>
The code callback.
Returns
Section titled “Returns”InstructionSet
This instruction set.
InstructConcurrent(params InstructionBase[])
Section titled “InstructConcurrent(params InstructionBase[])”Adds a ConcurrentInstructions to the end of this set.
public InstructionSet InstructConcurrent(params InstructionBase[] instructions)Parameters
Section titled “Parameters”instructions InstructionBase[]
Instructions to add. Must be two or more instructions.
Returns
Section titled “Returns”InstructionSet
This instruction set.