Show / Hide Table of Contents

Class PredicateInstruction

Instruction that waits until the code callback returns true.

Inheritance
object
UpdateComponent
InstructionBase
PredicateInstruction
Implements
IComponent
Inherited Members
InstructionBase.Reset()
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 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.

Overrides
InstructionBase.Update(IScreenObject, TimeSpan)

Implements

IComponent

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX