Grail (C#)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Planners.ObjectIndexBinding Class Reference

This class represents a binding between the in-game objects (Implementing IPlannerObject interface) and plan-space objects (used internally by the Planner) by means of WorldObjects.
Each mapping has an index associated that corresponds to the ordering in the list returned by the DomainTranslator.GeneratePlannerObjects(Core.AIEntity, Goal) method. More...

Public Member Functions

bool TryGetIndexOfObject (IPlannerObject plannerObject, out int index)
 Attempts to get the WorldObject's index associated within the binding that corresponds to the given IPlannerObject. More...
 
ObjectClass GetObjectByIndex< ObjectClass > (int index)
 Attempts to get a IPlannerObject corresponding to the given index stored in the binding. This function casts this object to the specified ObjectClass. More...
 

Detailed Description

This class represents a binding between the in-game objects (Implementing IPlannerObject interface) and plan-space objects (used internally by the Planner) by means of WorldObjects.
Each mapping has an index associated that corresponds to the ordering in the list returned by the DomainTranslator.GeneratePlannerObjects(Core.AIEntity, Goal) method.

Member Function Documentation

◆ GetObjectByIndex< ObjectClass >()

ObjectClass Grail.Planners.ObjectIndexBinding.GetObjectByIndex< ObjectClass > ( int  index)
inline

Attempts to get a IPlannerObject corresponding to the given index stored in the binding. This function casts this object to the specified ObjectClass.

Returns
The object fetched or as ObjectClass or null if the index was not found.
Type Constraints
ObjectClass :class 
ObjectClass :IPlannerObject 

◆ TryGetIndexOfObject()

bool Grail.Planners.ObjectIndexBinding.TryGetIndexOfObject ( IPlannerObject  plannerObject,
out int  index 
)
inline

Attempts to get the WorldObject's index associated within the binding that corresponds to the given IPlannerObject.

Returns
true if the plannerObject has been assigned, false otherwise

.


The documentation for this class was generated from the following file: