Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IGenericResourceTarget.ResourceIScript

The IGenericResourceTarget resource object target interface.

A generic resource target is used to encapsulate (possibly) any number of resource objects, referenced by their unique package/resource ID or directly by pointer. It provides access methods to add, remove or query the set of resource objects that are referenced. By using an IGenericResourceTarget, a graph node's process of handling references to resource objects can be unified, the respective resource object references may be acquired by either specifying a resource ID in an XML scene graph file, or directly set from code when a resource is obtained via a Resource::ICollection from a Logic::IProcessor.


Table members

Methods


Update()

Perform an update on the resource target.

Boolean Update()

Returns
Boolean true if successful.

IsInitialized()

Check if the resource target is initialized.

Boolean IsInitialized()

Returns
Boolean true if initialized.

IsModified()

Check if the resource target is modified. This method returns true, whenever the set of encapsulated resource references changes, either in size or by content. When modified, that state persists until a manual call to SetModified() with parameter false.

Boolean IsModified()

Returns
Boolean true if modified.

SetInitialized(initialized)

Manually set or reset the initialized state of the target.

Boolean SetInitialized(Boolean initialized)

Parameters
initializedThe initialized state.
Returns
Boolean true if successful.

SetModified(modified)

Manually set or reset the modified state of the target.

Boolean SetModified(Boolean modified)

Parameters
modifiedThe modified state.
Returns
Boolean true if successful.

GetMinNumberOfResources()

Query the minimum number of resource objects. This method returns the defined minimum number of resource object references that must be present for the Init() call to be successful.

Integer GetMinNumberOfResources()

Returns
Integer The required minimum number of resource objects for the target to be valid.

GetMaxNumberOfResources()

Query the maximum number of resource objects. This method returns the defined maximum number of resource object references that can be present for the Init() call to be successful.

Integer GetMaxNumberOfResources()

Returns
Integer The required maximum number of resource objects for the target to be valid.

SetNumberOfResources(numberOfResources)

Set the total number of resources. The given value must be in the range from GetMinNumberOfResources() to GetMaxNumberOfResources().

Boolean SetNumberOfResources(Integer numberOfResources)

Parameters
numberOfResourcesThe total number of resources in the target.
Returns
Boolean true if successful.

GetNumberOfResources()

Get the total number of resources.

Integer GetNumberOfResources()

Returns
Integer The total number of resources in the target.

SetResourceId(resourceId, index)

Set a single resource ID at a given index. You need to make sure that the given index is in the range from 0 to GetNumberOfResources()-1, use SetNumberOfResources() to define the actual node count.

Boolean SetResourceId(String resourceId, Integer index)

Parameters
resourceIdA string containing the full package name and ID to a resource object in the resource collection.
indexThe index of the resource ID to set, in the range from 0 to GetNumberOfResources()-1.
Returns
Boolean true if successful.

GetResourceId(index)

Get the resource ID at a given index.

String GetResourceId(Integer index)

Parameters
indexThe resource ID index in the range from 0 to GetNumberOfResources()-1.
Returns
String The total number of resource IDs in the target.

SetResource(object, index)

Set (replace) a single resource for referencing at a given position. You need to make sure that the given index is in the range from 0 to GetNumberOfResources()-1, use SetNumberOfResources() to define the actual node count.

Boolean SetResource(Murl.Resource.IScript object, Integer index)

Parameters
objectA pointer to the resource.
indexThe zero-based position where to set the resource, in the range from 0 to GetNumberOfResources()-1.
Returns
Boolean true if successful.

GetResource(index)

Get the resource at a given index.

Murl.Resource.IScript GetResource(Integer index)

Parameters
indexThe resource index in the range from 0 to GetNumberOfResources()-1.
Returns
Murl.Resource.IScript The resource at the given index.