Show / Hide Table of Contents

Class InstructionSet

A set of instructions to be executed sequentially.

Inheritance
object
UpdateComponent
InstructionBase
InstructionSet
Implements
IComponent
Inherited Members
InstructionBase.Repeat()
InstructionBase.OnFinished(IScreenObject)
InstructionBase.OnRepeating()
InstructionBase.OnStarted()
InstructionBase.RemoveOnFinished
InstructionBase.IsFinished
InstructionBase.RepeatCount
InstructionBase.Started
InstructionBase.Finished
InstructionBase.Repeating
UpdateComponent.OnAdded(IScreenObject)
UpdateComponent.OnRemoved(IScreenObject)
UpdateComponent.SortOrder
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole.Instructions
Assembly: SadConsole.dll
Syntax
public class InstructionSet : InstructionBase, IComponent

Constructors

InstructionSet()

Declaration
public InstructionSet()

Properties

CurrentInstruction

Represents the current instruction if this set is currently executing.

Declaration
public InstructionBase? CurrentInstruction { get; }
Property Value
Type Description
InstructionBase

Instructions

All instructions in this set.

Declaration
public LinkedList<InstructionBase> Instructions { get; }
Property Value
Type Description
LinkedList<InstructionBase>

Name

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

Declaration
public string Name { get; set; }
Property Value
Type Description
string

Methods

Code(Action)

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

Declaration
public InstructionSet Code(Action expression)
Parameters
Type Name Description
Action expression

The code callback.

Returns
Type Description
InstructionSet

This instruction set.

Code(Func<IScreenObject, TimeSpan, bool>)

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

Declaration
public InstructionSet Code(Func<IScreenObject, TimeSpan, bool> expression)
Parameters
Type Name Description
Func<IScreenObject, TimeSpan, bool> expression

The code callback.

Returns
Type Description
InstructionSet

This instruction set.

Instruct(InstructionBase)

Adds an instruction to the end of this set.

Declaration
public InstructionSet Instruct(InstructionBase instruction)
Parameters
Type Name Description
InstructionBase instruction
Returns
Type Description
InstructionSet

This instruction set.

InstructConcurrent(params InstructionBase[])

Adds a ConcurrentInstructions to the end of this set.

Declaration
public InstructionSet InstructConcurrent(params InstructionBase[] instructions)
Parameters
Type Name Description
InstructionBase[] instructions

Instructions to add. Must be two or more instructions.

Returns
Type Description
InstructionSet

This instruction set.

Reset()

Resets the Done flag.

Declaration
public override void Reset()
Overrides
InstructionBase.Reset()
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)

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

Declaration
public override void Update(IScreenObject componentHost, TimeSpan delta)
Parameters
Type Name Description
IScreenObject componentHost
TimeSpan delta
Overrides
InstructionBase.Update(IScreenObject, TimeSpan)

Wait(TimeSpan)

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

Declaration
public InstructionSet Wait(TimeSpan duration)
Parameters
Type Name Description
TimeSpan duration

The time to wait.

Returns
Type Description
InstructionSet

This instruction set.

WaitTrue(Func<bool>)

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

Declaration
public InstructionSet WaitTrue(Func<bool> expression)
Parameters
Type Name Description
Func<bool> expression

The code callback.

Returns
Type Description
InstructionSet

This instruction set.

Implements

IComponent

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX