Murl Engine Lua Addon API  Version 1.0 beta
Murl.ILoader

The loader interface.

The loader is a thread which provides functionality for loading and unloading resource packages parallel to the engine's logic and rendering processing.

The IEngineConfiguration::SetResourceFileCategory() setting specifies the working directory for the loader.

The ILoader object is provided by the IAppState and the Logic::IState object.


Table members

Enumerations


LoadMode

Definition of the load operation modes.

Murl.ILoader.LOAD_MODE_STARTUPLoad the package before engine startup.
Murl.ILoader.LOAD_MODE_BACKGROUNDLoad the package immediately in background.
Murl.ILoader.LOAD_MODE_ON_DEMANDLoad the package on demand using the IPackage.
Murl.ILoader.NUM_LOAD_MODES


Functions



Methods


AddProcessor(processor)

Add a logic processor without a package. Logic processors without a package can be added before startup only.

Boolean AddProcessor(Murl.SharedPointer.LogicIProcessor processor)

Parameters
processorThe logic processor to add.
Returns
Boolean true if successful.

RemoveProcessor(processor)

Remove a logic processor added by AddProcessor().

Boolean RemoveProcessor(Murl.SharedPointer.LogicIProcessor processor)

Parameters
processorThe logic processor to remove.
Returns
Boolean true if successful.

AddPackage(packageName, mode)

Create and register a package by name.

Murl.IPackage AddPackage(String packageName, Murl.ILoader.LoadMode mode)

Parameters
packageNameThe name of the package.
modeThe load mode.
Returns
Murl.IPackage The package object or null if creating the package failed.

AddPackage(packageName, category, mode)

Create and register a package by name and category.

Murl.IPackage AddPackage(String packageName, Murl.IEnums.FileCategory category, Murl.ILoader.LoadMode mode)

Parameters
packageNameThe name of the package.
categoryThe file category.
modeThe load mode.
Returns
Murl.IPackage The package object or null if creating the package failed.

AddPackage(packageName, category, mode, processor)

Create and register a package by name, category and a corresponding logic processor.

Murl.IPackage AddPackage(String packageName, Murl.IEnums.FileCategory category, Murl.ILoader.LoadMode mode, Murl.SharedPointer.LogicIProcessor processor)

Parameters
packageNameThe name of the package.
categoryThe file category.
modeThe load mode.
processorThe corresponding logic processor.
Returns
Murl.IPackage The package object or null if creating the package failed.

AddPackage(packageName, mode, processor)

Create and register a package by name and a corresponding logic processor.

Murl.IPackage AddPackage(String packageName, Murl.ILoader.LoadMode mode, Murl.SharedPointer.LogicIProcessor processor)

Parameters
packageNameThe name of the package.
modeThe load mode.
processorThe corresponding logic processor.
Returns
Murl.IPackage The package object or null if creating the package failed.

RemovePackage(packageName)

Remove a registered package by name. A package can be removed only if package is unloaded.

Boolean RemovePackage(String packageName)

Parameters
packageNameThe name of the package to remove.
Returns
Boolean true if successful.

GetPackage(packageName)

Get a registered package of a specified package name.

Murl.IPackage GetPackage(String packageName)

Parameters
packageNameThe name of the package.
Returns
Murl.IPackage The package object or null if the package name is not registered.

GetPackage(processor)

Get a registered package connected to a given processor.

Murl.IPackage GetPackage(Murl.SharedPointer.LogicIProcessor processor)

Parameters
processorThe processor to query.
Returns
Murl.IPackage The package object or null if no package is connected to the processor.

LoadPackage(packageName)

Load a registered package.

Boolean LoadPackage(String packageName)

Parameters
packageNameThe name of the package.
Returns
Boolean The result of IPackage::Load() or false if the package name is not registered.

UnloadPackage(packageName)

Load a registered package.

Boolean UnloadPackage(String packageName)

Parameters
packageNameThe name of the package.
Returns
Boolean The result of IPackage::Unload() or false if the package name is not registered.