C# Class ACR_CreatureBehavior.GameObjectManager

This class maintains state that links C# object state to undelrying engine game object representations.
Show file Open project: ALandFarAway/ALFA-Base-Resources Class Usage Examples

Public Methods

Method Description
AddGameObject ( ACR_CreatureBehavior.GameObject Obj ) : void

Insert an object into the game object table.

GameObjectManager ( ) : System

Construct a new GameObjectManager, and the underlying module object and the area list.

GetAreaObject ( uint ObjectId ) : ACR_CreatureBehavior.AreaObject

Get the C# area object for the given object id.

GetAreas ( ) : List

Get the list of all known areas.

GetCreatureObject ( uint ObjectId, bool CreateIfNeeded = false ) : CreatureObject

Get the C# creature object for the given object id.

GetGameObject ( uint ObjectId ) : ACR_CreatureBehavior.GameObject

Look up the internal GameObject for an object by object id and return the C# object state for it. The routine does not create the object state for an object id that is valid but unrecognized to us (i.e. that we have not yet seen even though it exists engine-side).

GetGameObject ( uint ObjectId, GameObjectType ObjectType ) : ACR_CreatureBehavior.GameObject

Look up the internal GameObject for an object by object id and return the C# object state for it, if the object type matched the expected type. The routine does not create the object state for an object id that is valid but unrecognized to us (i.e. that we have not yet seen even though it exists engine-side).

ProcessPendingDeletions ( ) : void

Called before we return to the engine, after all work has been finished. This function runs down objects marked for pending deletion (ensuring timely handling in cases where the deleted half of the object was explicitly detected).

RemoveGameObject ( ACR_CreatureBehavior.GameObject Obj ) : void

Remove an object from the game object table.

Private Methods

Method Description
GarbageCollectObjects ( ) : void

Periodically run as a DelayCommand continuation in order to scan the object table for objects whose engine parts have been deleted. Any such objects found are removed. It is necessary to periodically poll for deleted objects because not all object types provide script events that signify deletion.

GetGameObjectUnsafe ( uint ObjectId ) : ACR_CreatureBehavior.GameObject

Resolve an object ID to a GameObject without checking for deleted objects that need garbage collection. This function should only be used by the PowerShell diagnostics infrastructure.

GetGameObjectsUnsafe ( ) : ICollection

Return an enumerator over all of the GameObject instances in the system. Note that this enumerator does NOT check for deleted objects that need garbage collection! It is intended only for use by the PowerShell diagnostics interop infrastructure. Use the standard Get*Object interfaces instead otherwise.

Initialize ( ) : void

Called during initial script object initialization to set up the periodic garbage collection of objects to delete from the object dictionary.

Method Details

AddGameObject() public method

Insert an object into the game object table.
public AddGameObject ( ACR_CreatureBehavior.GameObject Obj ) : void
Obj ACR_CreatureBehavior.GameObject Supplies the object to insert.
return void

GameObjectManager() public method

Construct a new GameObjectManager, and the underlying module object and the area list.
public GameObjectManager ( ) : System
return System

GetAreaObject() public method

Get the C# area object for the given object id.
public GetAreaObject ( uint ObjectId ) : ACR_CreatureBehavior.AreaObject
ObjectId uint Supplies the object id to look up.
return ACR_CreatureBehavior.AreaObject

GetAreas() public method

Get the list of all known areas.
public GetAreas ( ) : List
return List

GetCreatureObject() public method

Get the C# creature object for the given object id.
public GetCreatureObject ( uint ObjectId, bool CreateIfNeeded = false ) : CreatureObject
ObjectId uint Supplies the object id to look up.
CreateIfNeeded bool If true, the C# Creature object for /// the creature is created if the object didn't already exist.
return CreatureObject

GetGameObject() public method

Look up the internal GameObject for an object by object id and return the C# object state for it. The routine does not create the object state for an object id that is valid but unrecognized to us (i.e. that we have not yet seen even though it exists engine-side).
public GetGameObject ( uint ObjectId ) : ACR_CreatureBehavior.GameObject
ObjectId uint Supplies the object id to look up.
return ACR_CreatureBehavior.GameObject

GetGameObject() public method

Look up the internal GameObject for an object by object id and return the C# object state for it, if the object type matched the expected type. The routine does not create the object state for an object id that is valid but unrecognized to us (i.e. that we have not yet seen even though it exists engine-side).
public GetGameObject ( uint ObjectId, GameObjectType ObjectType ) : ACR_CreatureBehavior.GameObject
ObjectId uint Supplies the object id to look up.
ObjectType GameObjectType Supplies the required object type.
return ACR_CreatureBehavior.GameObject

ProcessPendingDeletions() public method

Called before we return to the engine, after all work has been finished. This function runs down objects marked for pending deletion (ensuring timely handling in cases where the deleted half of the object was explicitly detected).
public ProcessPendingDeletions ( ) : void
return void

RemoveGameObject() public method

Remove an object from the game object table.
public RemoveGameObject ( ACR_CreatureBehavior.GameObject Obj ) : void
Obj ACR_CreatureBehavior.GameObject Supplies the object to remove.
return void