Skip to content

CodeInstruction Class

An instruction with a code callback.

C#
public class CodeInstruction : InstructionBase, IComponent

Inheritance objectUpdateComponentInstructionBase

Implements IComponent

CodeInstruction(Func<IScreenObject, TimeSpan, bool>)

Section titled “CodeInstruction(Func<IScreenObject, TimeSpan, bool>)”

Creates a new instruction with the specified callback.

C#
public CodeInstruction(Func<IScreenObject, TimeSpan, bool> callback)

callback Func<IScreenObject, TimeSpan, 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.

SetCallback(Func<IScreenObject, TimeSpan, bool>)

Section titled “SetCallback(Func<IScreenObject, TimeSpan, bool>)”

Sets the callback used by the instruction.

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

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