Murl Engine Lua Addon API  Version 1.0 beta
Murl.Logic.IStage

The IStage interface.

The IStage is an extended IProcessor containing a run state and an optional IStageTimeline object. An IStage object is controlled by the IStageProcessor.
Additional IProcessor objects can be added to the IStageProcessor object by using myStageProc->GetProcessor(myStageProc)->AddChild(). See also enum StageProcessing.


Table members

Enumerations


StageProcessing

Definiton of the stage processsing sequence. The sequence of calling the IAppStage callbacks and the IAppProcessor callbacks can be controlled.

Murl.Logic.IStage.BEFORE_STEPDefault, process stage before processor. - IAppStage::OnProcessStageTick() or OnProcessStageFrame(). - IAppStage::OnProcessTick[RUN_STATE_STATE]. - IAppProcessor::OnProcessTick() or OnProcessFrame(). - IAppProcessor::OnProcessTickChildren() or OnProcessFrameChildren().
Murl.Logic.IStage.BEFORE_CHILDRENProcess stage in between processor. - IAppProcessor::OnProcessTick() or OnProcessFrame(). - IAppStage::OnProcessStageTick() or OnProcessStageFrame(). - IAppStage::OnProcessTick[RUN_STATE_STATE]. - IAppProcessor::OnProcessTickChildren() or OnProcessFrameChildren().
Murl.Logic.IStage.AFTER_CHILDRENProcess stage after processor. - IAppProcessor::OnProcessTick() or OnProcessFrame(). - IAppProcessor::OnProcessTickChildren() or OnProcessFrameChildren(). - IAppStage::OnProcessStageTick() or OnProcessStageFrame(). - IAppStage::OnProcessTick[RUN_STATE_STATE].

RunState

Definition of RunStates controlled by the IStageProcessor.

Murl.Logic.IStage.RUN_STATE_STOPThe idle state. - No IAppStage and IAppProcessor callbacks are processed.
Murl.Logic.IStage.RUN_STATE_BEGIN_INTROThe begin intro state. - If the IStageProcessor switch is set, set the switch to the stage's switch identifier. - If the IStageTimeline is set, execute IStageTimeline::StartIntro(). - Call IAppStage::OnProcessStageTickBeginIntro(). - Switch to RUN_STATE_RUN_INTRO if run state is unchanged.
Murl.Logic.IStage.RUN_STATE_RUN_INTROThe run intro state. - Call IAppStage::OnProcessStageTickRunIntro(). - If the IStageTimeline is set and not running, switch to RUN_STATE_BEGIN_RUN if run state is unchanged.
Murl.Logic.IStage.RUN_STATE_BEGIN_RUNThe begin run state. - Call IAppStage::OnProcessStageTickBeginRun(). - Switch to RUN_STATE_RUN if run state is unchanged.
Murl.Logic.IStage.RUN_STATE_RUNThe run state. - Call IAppStage::OnProcessStageTickRun().
Murl.Logic.IStage.RUN_STATE_BEGIN_OUTROThe begin outro state. - If the IStageTimeline is set, execute IStageTimeline::StartOutro(). - Call IAppStage::OnProcessStageTickBeginOutro(). - Switch to RUN_STATE_RUN_OUTRO if run state is unchanged.
Murl.Logic.IStage.RUN_STATE_RUN_OUTROThe run outro state. - Call IAppStage::OnProcessStageTickRunOutro(). - If the IStageTimeline is set and not running, switch to RUN_STATE_STOP and call IAppStage::OnProcessStageTickStop() if run state is unchanged.


Functions



Methods


GetProcessor()

Get the processor interface from a stage object. The IStage conforms to the IProcessor interface.

Murl.SharedPointer.LogicIProcessor GetProcessor()

Returns
Murl.SharedPointer.LogicIProcessor The processor interface shared pointer.

SetStageProcessing(processing)

Set the stage processing sequence.

SetStageProcessing(Murl.Logic.IStage.StageProcessing processing)

Parameters
processingThe stage processing sequence.

GetStageProcessing()

Get the stage processing sequence.

Murl.Logic.IStage.StageProcessing GetStageProcessing()

Returns
Murl.Logic.IStage.StageProcessing The stage processing sequence.

SetAppStage(appStage)

Set the stage callback object.

Boolean SetAppStage(Murl.SharedPointer.LogicIAppStage appStage)

Parameters
appStageThe stage callback object.
Returns
Boolean true if successful.

SetStageId(stageId)

Set the stage identifier. The stage identifier is used by the IStageProcessor to select stages by string identifier.

SetStageId(String stageId)

Parameters
stageIdThe stage identifier.

GetStageId()

Get the stage identifier.

String GetStageId()

Returns
String The stage identifier string.

SetSwitchId(switchId)

Set the graph switch child identifier. See IStageProcessor description.

SetSwitchId(String switchId)

Parameters
switchIdThe graph switch child identifier.

GetSwitchId()

Get the graph switch child identifier.

String GetSwitchId()

Returns
String The graph switch child identifier.

SetRunState(runState)

Set the current run state.

SetRunState(Murl.Logic.IStage.RunState runState)

Parameters
runStateThe run state to set.

IsRunState(runState)

Check the current run state.

Boolean IsRunState(Murl.Logic.IStage.RunState runState)

Parameters
runStateThe run state to compare.
Returns
Boolean true if the current run state is equal.

GetRunState()

Get the current run state.

Murl.Logic.IStage.RunState GetRunState()

Returns
Murl.Logic.IStage.RunState The current run state.

StartStageIntro()

Start a stage intro. If the current run state is RUN_STATE_STOP, set the RUN_STATE_BEGIN_INTRO.

Boolean StartStageIntro()

Returns
Boolean true if successful, false if the run state check failed.

StartStageOutro()

Start a stage intro. If the current run state is not RUN_STATE_STOP, set the RUN_STATE_BEGIN_OUTRO.

Boolean StartStageOutro()

Returns
Boolean true if successful, false if the run state check failed.

StopStage()

Stop the stage. If the current run state is not RUN_STATE_STOP, set the RUN_STATE_STOP.
(!) IAppStage::OnStop() is not executed.

Boolean StopStage()

Returns
Boolean true if successful, false if the run state check failed.

IsStageStopped()

Check if stage is stopped.

Boolean IsStageStopped()

Returns
Boolean true if run state is RUN_STATE_STOP.

CreateStageTimeline(state, timeline, introTime, outroTime)

Create and initialize the IStageTimeline object. The IStageTimeline object created is deinitialized and destroyed automatically by DeInitStage().
The intro start time is set to zero, the outro start time is set to the intro end time by default. The intro / outro time can be modified at any time by accessing the IStageTimeline object using GetStageTimeline().

Boolean CreateStageTimeline(Murl.Logic.IState state, String timeline, Number introTime, Number outroTime)

Parameters
stateThe IState object.
timelineThe full path to the graph <Timeline> instance.
introTimeThe intro end time in seconds,
outroTimeThe outro end time in seconds,
Returns
Boolean true if successful.

SetStageTimeline(stageTimeline)

Set the IStageTimeline object. The IStageTimeline object is not affected by DeInitStage().

Boolean SetStageTimeline(Murl.SharedPointer.LogicIStageTimeline stageTimeline)

Parameters
stageTimelineAn initialized IStageTimeline object.
Returns
Boolean true if successful.

GetStageTimeline()

Get the IStageTimeline object.

Murl.SharedPointer.LogicIStageTimeline GetStageTimeline()

Returns
Murl.SharedPointer.LogicIStageTimeline The IStageTimeline object, or null if not available.

InitStage(state, stageProcessor)

Initialize the stage. This method is typically used by the corresponding IStageProcessor. Execute IAppProcessor::OnInit(), IAppStage::OnInitStage() and initialization of all processor's children.

Boolean InitStage(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.
Returns
Boolean true if successful.

DeInitStage(state, stageProcessor)

Deinitialize the stage. This method is typically used by the corresponding IStageProcessor. Execute deinitialization of all processor's children, AppStage::OnDeInitStage() and IAppProcessor::OnDeInit().

Boolean DeInitStage(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.
Returns
Boolean true if successful.

ProcessStageTick(state, stageProcessor)

Execute a logic tick. This method is typically used by the corresponding IStageProcessor.
Evaluate the StageProcessing state to execute the IProcessor logic tick and the ProcessStageTickSelf() method.

ProcessStageTick(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.

ProcessStageFrame(state, stageProcessor)

Execute a frame tick. This method is typically used by the corresponding IStageProcessor.
Evaluate the StageProcessing state to execute the IProcessor frame tick and the ProcessStageFrameSelf() method.

ProcessStageFrame(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.

FinishStageTick(state, stageProcessor)

Finish a logic tick. This method is typically used by the corresponding IStageProcessor.

FinishStageTick(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.

FinishStageFrame(state, stageProcessor)

Finish a frame tick. This method is typically used by the corresponding IStageProcessor.

FinishStageFrame(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.

ProcessStageTickSelf(state, stageProcessor)

Execute a IAppStage logic tick. This method is typically used by IStage::ProcessStageTick() method.
Execute the IAppStage::OnProcessStageTick() method first and afterwards the IAppStage::OnProcessTick[RUN_STATE_STATE] method depending on the current RunState.

ProcessStageTickSelf(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.

ProcessStageFrameSelf(state, stageProcessor)

Execute a IAppStage frame tick. This method is typically used by IStage::ProcessStageFrame() method.
Execute the IAppStage::OnProcessStageFrame() method.

ProcessStageFrameSelf(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.

FinishStageTickSelf(state, stageProcessor)

Finish a IAppStage logic tick. This method is typically used by IStage::ProcessStageTick() method.

FinishStageTickSelf(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.

FinishStageFrameSelf(state, stageProcessor)

Finish a IAppStage frame tick. This method is typically used by IStage::ProcessStageFrame() method.

FinishStageFrameSelf(Murl.Logic.IState state, Murl.Logic.IStageProcessor stageProcessor)

Parameters
stateThe IState object.
stageProcessorThe corresponding IStageProcessor object.