Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::planner::ObjectIndexBinding Class Reference

#include <ObjectIndexBinding.hh>

Public Member Functions

bool TryGetIndexOfObject (const IPlannerObject *object, unsigned int &outIndex) const
 
template<class ObjectClass >
ObjectClass * GetObjectByIndex (unsigned int index) const
 

Friends

class DomainTranslator
 

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 "WorldObject" 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()

template<class ObjectClass >
ObjectClass* grail::planner::ObjectIndexBinding::GetObjectByIndex ( unsigned int  index) const
inline

Attempts to get IPlannerObject corresponding to the given WorldObject index and cast it to the specified ObjectClass. WARNING! This method uses static_cast!

Returns
The requested object pointer if the index is valid, nullptr otherwise

◆ TryGetIndexOfObject()

bool grail::planner::ObjectIndexBinding::TryGetIndexOfObject ( const IPlannerObject object,
unsigned int &  outIndex 
) const

Attempts to get WorldObject index corresponding to the given IPlannerObject.

Returns
true if a proper value has been assigned to outIndex, false otherwise

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