Class PredicateInstruction
Instruction that waits until the code callback returns true.
Implements
Inherited Members
Namespace: SadConsole.Instructions
Assembly: SadConsole.dll
Syntax
public class PredicateInstruction : InstructionBase, IComponent
Constructors
PredicateInstruction(Func<bool>)
Creates a new instruction with the specified callback.
Declaration
public PredicateInstruction(Func<bool> callback)
Parameters
Type | Name | Description |
---|---|---|
Func<bool> | callback | The code invoked by this instruction. Return true to set IsFinished. |
Properties
ID
Friendly ID to help track what this code instruction was created from since it cannot be fully serialized.
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
SetCallback(Func<bool>)
Sets the callback used by the instruction.
Declaration
public void SetCallback(Func<bool> callback)
Parameters
Type | Name | Description |
---|---|---|
Func<bool> | callback | The code invoked by this instruction. Return true to set IsFinished. |
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. |