This is the type the library works with. It interacts with it's real world entity by the ICharacter interface.
More...
#include <AI.h>
|
| AI (const TreeNodePtr &behaviour) |
|
virtual void | update (int64_t dt, bool debuggingActive) |
| Update the behaviour and the aggro values if the entity is not on hold. More...
|
|
void | setZone (Zone *zone) |
| Set the new Zone this entity is in.
|
|
Zone * | getZone () const |
|
bool | hasZone () const |
| Returns true if the entity is already in a Zone. This must not be managed manually, the Zone is doing that already.
|
|
void | setPause (bool pause) |
| don't update the entity as long as it is paused More...
|
|
bool | isPause () const |
| don't update the entity as long as it is paused More...
|
|
bool | isDebuggingActive () const |
|
TreeNodePtr | getBehaviour () const |
| Get the current behaviour for this ai.
|
|
TreeNodePtr | setBehaviour (const TreeNodePtr &newBehaviour) |
| Set a new behaviour. More...
|
|
ICharacterPtr | getCharacter () const |
|
void | setCharacter (const ICharacterPtr &character) |
|
template<typename CharacterType > |
CharacterType & | getCharacterCast () const |
|
int64_t | getTime () const |
|
CharacterId | getId () const |
|
AggroMgr & | getAggroMgr () |
|
const AggroMgr & | getAggroMgr () const |
|
const FilteredEntities & | getFilteredEntities () const |
| FilteredEntities is holding a list of CharacterIds that were selected by the Select condition. More...
|
|
std::shared_ptr< AI > | ptr () |
|
|
void | setFilteredEntities (const FilteredEntities &filteredEntities) |
|
void | addFilteredEntity (CharacterId id) |
|
|
class | TreeNode |
|
class | LUAAIRegistry |
|
class | IFilter |
|
class | Filter |
|
class | Server |
|
This is the type the library works with. It interacts with it's real world entity by the ICharacter interface.
Each ai entity has a [AggroMgr} assigned that is updated with each tick (update()).
A behaviour can be replaced at runtime with setBehaviour()
You can set single AI
instances to no longer update their state by calling setPause()
This map is only filled if we are in debugging mode for this entity
This map stores the amount of execution for the Limit node. The key is the node id
This map is only filled if we are in debugging mode for this entity
Often Selector states must be stored to continue in the next step at a particular position in the behaviour tree. This map is doing exactly this.
ai::AI::AI |
( |
const TreeNodePtr & |
behaviour | ) |
|
|
inlineexplicit |
- Parameters
-
behaviour | The behaviour tree node that is applied to this ai entity |
const AggroMgr & ai::AI::getAggroMgr |
( |
| ) |
const |
|
inline |
ICharacterPtr ai::AI::getCharacter |
( |
| ) |
const |
|
inline |
- Returns
- The real world entity reference
const FilteredEntities & ai::AI::getFilteredEntities |
( |
| ) |
const |
|
inline |
FilteredEntities
is holding a list of CharacterIds
that were selected by the Select
condition.
- See Also
IFilter
interface.
-
Filter
condition that executes assigned IFilter
implementations.
- Returns
- A reference to the internal data structure. This should only be used from within
TreeNode
implementations to access those entities that were filtered by the Filter
condition.
- Note
- If you call this from outside of the behaviour tree tick, you will run into race conditions.
Zone * ai::AI::getZone |
( |
| ) |
const |
|
inline |
Returns the Zone this entity is in.
bool ai::AI::isDebuggingActive |
( |
| ) |
const |
|
inline |
- Returns
true
if the owning entity is currently under debugging, false
otherwise
bool ai::AI::isPause |
( |
| ) |
const |
|
inline |
don't update the entity as long as it is paused
- See Also
- setPause()
std::shared_ptr<AI> ai::AI::ptr |
( |
| ) |
|
|
inline |
If the object is currently maintained by a shared_ptr, you can get a shared_ptr from a raw pointer instance that shares the state with the already existing shared_ptrs around.
TreeNodePtr ai::AI::setBehaviour |
( |
const TreeNodePtr & |
newBehaviour | ) |
|
|
inline |
Set a new behaviour.
- Returns
- the old one if there was any
void ai::AI::setCharacter |
( |
const ICharacterPtr & |
character | ) |
|
|
inline |
You might not set a character twice to an AI
instance.
void ai::AI::setPause |
( |
bool |
pause | ) |
|
|
inline |
don't update the entity as long as it is paused
- See Also
- isPause()
void ai::AI::update |
( |
int64_t |
dt, |
|
|
bool |
debuggingActive |
|
) |
| |
|
inlinevirtual |
Update the behaviour and the aggro values if the entity is not on hold.
- Parameters
-
[in] | dt | The current milliseconds to update the aggro entries and time based tasks or conditions. |
FilteredEntities ai::AI::_filteredEntities |
|
mutableprotected |
- Note
- The filtered entities are kept even over several ticks. The caller should decide whether he still needs an old/previous filtered selection
- See Also
- IFilter
The documentation for this class was generated from the following file:
- /home/travis/build/mgerhardy/simpleai/src/ai/AI.h