Skip to content

PredicateInstruction Class

Instruction that waits until the code callback returns true.

C#
public class PredicateInstruction : InstructionBase, IComponent

Inheritance objectUpdateComponentInstructionBase

Implements IComponent

Creates a new instruction with the specified callback.

C#
public PredicateInstruction(Func<bool> callback)

callback Func<bool>
The code invoked by this instruction. Return true to set IsFinished.

Friendly ID to help track what this code instruction was created from since it cannot be fully serialized.

C#
public string ID { get; set; }

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.

C#
public override void Update(IScreenObject componentHost, TimeSpan delta)

componentHost IScreenObject
The object that hosts this instruction.

delta TimeSpan
The time that has elapsed since this method was last called.

Sets the callback used by the instruction.

C#
public void SetCallback(Func<bool> callback)

callback Func<bool>
The code invoked by this instruction. Return true to set IsFinished.