Murl Engine Lua Addon API  Version 1.0 beta
Murl.IApp

The application interface.

An application implements the IApp interface to integrate to the engine.


Table members

Functions


Murl.IApp.new(callbackTable)

Create a callback object with a given callback table.

Example of a callback table:

local myIApp =
{
Configure = function (self, engineConfig, fileInterface)
-- user code
return true
end,
IsUserConfigurationMatching = function (self, userConfigId)
-- user code
return false
end,
RegisterCustomAddonClasses = function (self, addonRegistry)
-- user code
return true
end,
UnregisterCustomAddonClasses = function (self, addonRegistry)
-- user code
return true
end,
Init = function (self, appState)
-- user code
return true
end,
DeInit = function (self, appState)
-- user code
return true
end,
}
return Murl.IApp.new(myIApp)

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

Murl.IApp new(Table callbackTable)

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


Methods


Configure(engineConfig, fileInterface)

Configure the application. This method is called by the platform first of all to provide the current platform configuration to the application. At this point the application can read the platform configuration and setup the app configuration and the engine configuration. The application can return false to abort starting the application.

Boolean Configure(Murl.IEngineConfiguration engineConfig, Murl.IFileInterface fileInterface)

Parameters
engineConfigThe engine configuration object.
fileInterfaceThe file interface object.
Returns
Boolean true if successful.

IsUserConfigurationMatching(userConfigId)

Check if the current app configuration matches a given user ID. This method is called by the engine whenever a resource object or graph node needs to be created that depends on some user-defined condition. The app should return true whenever the queried user configuration ID matches the current configuration.

Boolean IsUserConfigurationMatching(String userConfigId)

Parameters
userConfigIdA string representing the user-defined configuration to be queried.
Returns
Boolean true if the current configuration is represented by the given ID.

RegisterCustomAddonClasses(addonRegistry)

Register custom add-ons with the engine. This method is called by the engine core before initializing the application, and also before any of the other register methods below. It allows the application to create and register custom add-ons as needed, which in turn are allowed to register their own factory and module classes.

Boolean RegisterCustomAddonClasses(Murl.IAppAddonRegistry addonRegistry)

Parameters
addonRegistryThe registry to access individual add-ons.
Returns
Boolean true if successful.

UnregisterCustomAddonClasses(addonRegistry)

Unregister custom add-ons from the engine. This method is called by the engine core after deinitializing the application, and after all configuration-dependent modules and factory classes have been released. See RegisterCustomAddonClasses().

Boolean UnregisterCustomAddonClasses(Murl.IAppAddonRegistry addonRegistry)

Parameters
addonRegistryThe registry to access individual add-ons.
Returns
Boolean true if successful.

Init(appState)

Initialize the application. This method is called by the engine core for application initialization. At this point an application can trigger loading resources and creating Logic::IProcessor objects.

Boolean Init(Murl.IAppState appState)

Parameters
appStateThe application state object.
Returns
Boolean true if successful.

DeInit(appState)

Deinitialize the application. This method is called by the engine core for application deinitialization. At this point an application can destroy Logic::IProcessor objects.

Boolean DeInit(Murl.IAppState appState)

Parameters
appStateThe application state object.
Returns
Boolean true if successful.