Murl Engine Lua Addon API  Version 1.0 beta
Murl.Resource.ICollection

The resource collection interface.

A resource collection provides methods to manage individual Resource::IPackage objects, which contain a number of individual Resource::IObject instances. The resource collection also provides methods to retrieve individual objects via a package/object identifier pair in the form "packageId:objectId", as in GetObject() and related methods.


Table members

Methods


GetCollectionInterface()

Get the constant ICollection interface.

Murl.Resource.ICollection GetCollectionInterface()

Returns
Murl.Resource.ICollection The ICollection interface.

Init()

Initialize this collection.

Boolean Init()

Returns
Boolean true if successful.

DeInit()

De-initialize this collection.

Boolean DeInit()

Returns
Boolean true if successful.

RegisterPackageData(name, data)

Register a specific package from a block of memory. This method can be used to register a package from memory as if it was a file on disk. Internally, the CreatePackageFromFile() first checks if any package with the given file name was registered through this method before actually searching the file system.

Boolean RegisterPackageData(String name, Murl.ConstData data)

Parameters
nameThe file name to register.
dataA Data object containing the binary package.
Returns
Boolean true if successful.

UnregisterPackageData(name)

Unregister a package previously registered through RegisterPackageData().

Boolean UnregisterPackageData(String name)

Parameters
nameThe file name to unregister.
Returns
Boolean true if successful.

DestroyPackage(package)

Destroy a previously created package.

Boolean, Murl.Resource.IPackage DestroyPackage(Murl.Resource.IPackage package)

Parameters
packageA reference to a pointer holding the package to destroy.
Returns
Boolean true if successful.
Murl.Resource.IPackage package A reference to a pointer holding the package to destroy.

GetNumberOfPackages()

Get the total number of packages in this collection.

Integer GetNumberOfPackages()

Returns
Integer The number of packages.

GetPackage(index)

Get the package at a given index.

Murl.Resource.IPackage GetPackage(Integer index)

Parameters
indexThe index of the package, from 0 to GetNumberOfPackages()-1.
Returns
Murl.Resource.IPackage A pointer to the package, or null if the index is out of range.

GetPackage(id)

Get a package by its ID.

Murl.Resource.IPackage GetPackage(String id)

Parameters
idThe package ID to query.
Returns
Murl.Resource.IPackage A pointer to the package, or null if a package with given ID was not found.

GetBinary(id)

Get a single object as a specialized Resource::IBinary. See GetObject().

Murl.Resource.IBinary GetBinary(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IBinary A pointer to the specialized object, or null if not found.

GetGraph(id)

Get a single object as a specialized Resource::IGraph. See GetObject().

Murl.Resource.IGraph GetGraph(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IGraph A pointer to the specialized object, or null if not found.

GetImage(id)

Get a single object as a specialized Resource::IImage. See GetObject().

Murl.Resource.IImage GetImage(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IImage A pointer to the specialized object, or null if not found.

GetMesh(id)

Get a single object as a specialized Resource::IMesh. See GetObject().

Murl.Resource.IMesh GetMesh(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IMesh A pointer to the specialized object, or null if not found.

GetFont(id)

Get a single object as a specialized Resource::IFont. See GetObject().

Murl.Resource.IFont GetFont(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IFont A pointer to the specialized object, or null if not found.

GetShader(id)

Get a single object as a specialized Resource::IShader. See GetObject().

Murl.Resource.IShader GetShader(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IShader A pointer to the specialized object, or null if not found.

GetAudio(id)

Get a single object as a specialized Resource::IAudio. See GetObject().

Murl.Resource.IAudio GetAudio(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IAudio A pointer to the specialized object, or null if not found.

GetAnimation(id)

Get a single object as a specialized Resource::IAnimation. See GetObject().

Murl.Resource.IAnimation GetAnimation(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IAnimation A pointer to the specialized object, or null if not found.

GetAtlas(id)

Get a single object as a specialized Resource::IAtlas. See GetObject().

Murl.Resource.IAtlas GetAtlas(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IAtlas A pointer to the specialized object, or null if not found.

GetArchive(id)

Get a single object as a specialized Resource::IArchive. See GetObject().

Murl.Resource.IArchive GetArchive(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IArchive A pointer to the specialized object, or null if not found.

GetVideo(id)

Get a single object as a specialized Resource::IVideo. See GetObject().

Murl.Resource.IVideo GetVideo(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IVideo A pointer to the specialized object, or null if not found.

GetScript(id)

Get a single object as a specialized Resource::IScript. See GetObject().

Murl.Resource.IScript GetScript(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IScript A pointer to the specialized object, or null if not found.

GetDictionary(id)

Get a single object as a specialized Resource::IDictionary. See GetObject().

Murl.Resource.IDictionary GetDictionary(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IDictionary A pointer to the specialized object, or null if not found.

GetGrid(id)

Get a single object as a specialized Resource::IGrid. See GetObject().

Murl.Resource.IGrid GetGrid(String id)

Parameters
idThe ID of the object to retrieve.
Returns
Murl.Resource.IGrid A pointer to the specialized object, or null if not found.

GetText(id)

Get a single text resource. See GetObject().

Murl.Resource.IText GetText(String id)

Parameters
idThe ID of the text to retrieve.
Returns
Murl.Resource.IText A pointer to the text object, or null if not found.

SetParentPackage(parentPackage)

Set the optional parent package this collection belongs to.

Boolean SetParentPackage(Murl.Resource.IPackage parentPackage)

Parameters
parentPackageThe containing package, or null for removing.
Returns
Boolean true if successful.

GetParentPackage()

Get the optional parent package this collection belongs to.

Murl.Resource.IPackage GetParentPackage()

Returns
Murl.Resource.IPackage The containing package, or null if the collection is not contained in another package.

SetParentCollection(parentCollection)

Set the optional parent collection. An optional parent collection can be defined to perform an additional search for a resource (via package and object ID) if it cannot be found in this collection.

Boolean SetParentCollection(Murl.Resource.ICollection parentCollection)

Parameters
parentCollectionThe parent collection, or null for removing.
Returns
Boolean true if successful.

GetParentCollection()

Get the optional parent collection.

Murl.Resource.ICollection GetParentCollection()

Returns
Murl.Resource.ICollection The parent collection, or null if not defined.

GetNumberOfAllocatedResourceBytes()

Query the total number of allocated resource bytes in this collection.

Integer GetNumberOfAllocatedResourceBytes()

Returns
Integer The number of allocated bytes.