(C++)  1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::planning::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 represets a binding between in-game objects (Implementing IPlannerObject interface) and plan-space World Objects

Member Function Documentation

template<class ObjectClass >
ObjectClass* grail::planning::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
bool grail::planning::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: