Class ConcurrentInstructions
Runs one or more instructions at the same time. This instruction completes when all added instructions have finished.
Implements
Inherited Members
Namespace: SadConsole.Instructions
Assembly: SadConsole.dll
Syntax
public class ConcurrentInstructions : InstructionBase, IComponent
Constructors
ConcurrentInstructions(IEnumerable<InstructionBase>)
Creates a new instruction that runs the provided instructions concurrently.
Declaration
public ConcurrentInstructions(IEnumerable<InstructionBase> instructions)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<InstructionBase> | instructions | The instructions |
Properties
Instructions
The instructions to run concurrently.
Declaration
public IEnumerable<InstructionBase> Instructions { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<InstructionBase> |
Methods
Repeat()
Repeats the current instruction. Decrements the RepeatCount value (if applicable), and raises the Repeating event. This method should be overridden in derived classes to customize how the object is reset for a repeat.
Declaration
public override void Repeat()
Overrides
Reset()
Resets the Done flag.
Declaration
public override void Reset()
Overrides
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)
Executes the instruction. This base class method should be called from derived classes. If the IsFinished property is set to true, will try to repeat if needed and will raise all appropriate events.
Declaration
public override void Update(IScreenObject componentHost, TimeSpan delta)
Parameters
Type | Name | Description |
---|---|---|
IScreenObject | componentHost | The object that hosts this instruction. |
TimeSpan | delta | The time that has elapsed since this method was last called. |