![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
Perform an update on the resource target.
Boolean Update()
Check if the resource target is initialized.
Boolean IsInitialized()
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()
Manually set or reset the initialized state of the target.
Boolean SetInitialized(Boolean initialized)
initialized | The initialized state. |
Manually set or reset the modified state of the target.
Boolean SetModified(Boolean modified)
modified | The modified state. |
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()
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()
Set the total number of resources. The given value must be in the range from GetMinNumberOfResources() to GetMaxNumberOfResources().
Boolean SetNumberOfResources(Integer numberOfResources)
numberOfResources | The total number of resources in the target. |
Get the total number of resources.
Integer GetNumberOfResources()
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)
resourceId | A string containing the full package name and ID to a resource object in the resource collection. |
index | The index of the resource ID to set, in the range from 0 to GetNumberOfResources()-1. |
Get the resource ID at a given index.
String GetResourceId(Integer index)
index | The resource ID index in the range from 0 to GetNumberOfResources()-1. |
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.IGraph object, Integer index)
object | A pointer to the resource. |
index | The zero-based position where to set the resource, in the range from 0 to GetNumberOfResources()-1. |
Get the resource at a given index.
Murl.Resource.IGraph GetResource(Integer index)
index | The resource index in the range from 0 to GetNumberOfResources()-1. |