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

The IAppGraph interface.

This interface is used by the Graph::ILogicController object to callback the app.


Table members

Functions


Murl.Logic.IAppGraph.new(callbackTable)

Create a callback object with a given callback table.

Example of a callback table:

local myIAppGraph =
{
OnPreInit = function (self, state)
-- user code
return true
end,
OnPostInit = function (self, state)
-- user code
return true
end,
OnPreDeInit = function (self, state)
-- user code
return true
end,
OnPostDeInit = function (self, state)
-- user code
return true
end,
OnPreProcessTick = function (self, state)
-- user code
end,
OnPostProcessTick = function (self, state)
-- user code
end,
OnPreConfigChanged = function (self, state)
-- user code
end,
OnPostConfigChanged = function (self, state)
-- user code
end,
OnPreInitConfigChanged = function (self, state, recentAppGraph)
-- user code
return true
end,
OnPostInitConfigChanged = function (self, state, recentAppGraph)
-- user code
return true
end,
}
return Murl.Logic.IAppGraph.new(myIAppGraph)

Is is allowed to omit unused callback functions and to add user specific fields to the table.

Murl.Logic.IAppGraph new(Table callbackTable)

Parameters
callbackTableA table containing the methods to callback.
Returns
Murl.Logic.IAppGraph The created calback object.


Methods


OnPreInit(state)

Called by Graph::ILogicController at initialization. Perform initializaton before the node and its children are being initialized.

Boolean OnPreInit(Murl.Logic.IState state)

Parameters
stateThe IState object.
Returns
Boolean true if successful, should return false if any initialization failed.

OnPostInit(state)

Called by Graph::ILogicController at initialization. Perform initializaton after the node and its children have been initialized.

Boolean OnPostInit(Murl.Logic.IState state)

Parameters
stateThe IState object.
Returns
Boolean true if successful, should return false if any initialization failed.

OnPreDeInit(state)

Called by Graph::ILogicController at deinitialization. Perform de-initializaton step before the node and its children are being de-initialized.

Boolean OnPreDeInit(Murl.Logic.IState state)

Parameters
stateThe IState object.
Returns
Boolean true if successful, should return false if any deinitialization failed.

OnPostDeInit(state)

Called by Graph::ILogicController at deinitialization. Perform de-initializaton step after the node and its children have been de-initialized.

Boolean OnPostDeInit(Murl.Logic.IState state)

Parameters
stateThe IState object.
Returns
Boolean true if successful, should return false if any deinitialization failed.

OnPreProcessTick(state)

Called by Graph::ILogicController each logic tick. Performed by graph logic traversal, before the node is being processed.

OnPreProcessTick(Murl.Logic.IState state)

Parameters
stateThe IState object.

OnPostProcessTick(state)

Called by Graph::ILogicController each logic tick. Performed by graph logic traversal, after the node's children have been processed.

OnPostProcessTick(Murl.Logic.IState state)

Parameters
stateThe IState object.

OnPreConfigChanged(state)

Called by Graph::ILogicController if the configuration changed. Signal a configuration change, before the node is being processed.

OnPreConfigChanged(Murl.Logic.IState state)

Parameters
stateThe IState object.

OnPostConfigChanged(state)

Called by Graph::ILogicController if the configuration changed. Signal a configuration change, after the node's children have been processed.

OnPostConfigChanged(Murl.Logic.IState state)

Parameters
stateThe IState object.

OnPreInitConfigChanged(state, recentAppGraph)

Called by Graph::IScriptLogicController if the configuration changed. Signal a configuration change, before the node is being processed.

If a new configuration dependent controller script is created the following is called:

  • New controller: OnPreInitConfigChanged() or OnPreInit() if no recent controller is available
  • Recent controller: OnPreDeInit()

If no new configuration dependent controller script is created the OnPreConfigChanged() method of the recent controller is called.

Boolean OnPreInitConfigChanged(Murl.Logic.IState state, Murl.SharedPointer.LogicIAppGraph recentAppGraph)

Parameters
stateThe IState object.
recentAppGraphThe recent IAppGraph interface object.
Returns
Boolean true if successful, should return false if any initialization failed.

OnPostInitConfigChanged(state, recentAppGraph)

Called by Graph::IScriptLogicController if the configuration changed. Signal a configuration change, after the node's children have been processed.

If a new configuration dependent controller script is created the following is called:

  • New controller: OnPostInitConfigChanged() or OnPostInit() if no recent controller is available
  • Recent controller: OnPostDeInit()

If no new configuration dependent controller script is created the OnPostConfigChanged() method of the recent controller is called.

Boolean OnPostInitConfigChanged(Murl.Logic.IState state, Murl.SharedPointer.LogicIAppGraph recentAppGraph)

Parameters
stateThe IState object.
recentAppGraphThe recent IAppGraph interface object.
Returns
Boolean true if successful, should return false if any initialization failed.