grail (C  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.AIManager Class Reference

Manages registered entities and shared blackboards. More...

Inheritance diagram for Grail.AIManager:
Collaboration diagram for Grail.AIManager:

Public Member Functions

 AIManager (int threadNumber=0)
 Constructs manager and spawns worker threads defined by parameter. If threadsNumber equals 0, all calculations will be done on main thread. More...
 
void Dispose ()
 
void RegisterAIEntity (AIEntity entity, int priority)
 Manager registers entity with given priority. More...
 
void RegisterAIEntity (AIEntity entity, AIEntity parent, int priorityOffset)
 Managers registers entity with priority worse by priorityOffset than in case of parent entity. More...
 
void RegisterEntityGroup (EntityGroup entityGroup, int priority)
 
void RemoveEntityGroup (EntityGroup entityGroup)
 
void RemoveAIEntity (AIEntity entity)
 Manager caches given entity. Later on all cached entities will be unregistered from this manager. More...
 
Blackboard CreateBlackboard (string blackboardName)
 Constructs blackboard owned by this manager. More...
 
void SubscribeToBlackboard (string blackboardName, AIEntity entity)
 Subscribed given entity to blackboard identified by blackboard name and owned by this manager More...
 
void UpdateEntities (float deltaTime)
 Updates entities and their assigned behaviors. More...
 
void UpdateReasoners ()
 Lets registered entities think by updating their reasoners. More...
 
void RegisterEntityChangeObserver (IEntityChangeObserver observer)
 
void RemoveEntityChangeObserver (IEntityChangeObserver observer)
 
bool ContainsEntity (AIEntity entity)
 

Properties

List<(AIEntity entity, int priority)> Entities [get]
 
List< EntityGroupEntityGroups = new List<EntityGroup>() [get]
 
Dictionary< string, BlackboardSharedBlackboards [get]
 

Detailed Description

Manages registered entities and shared blackboards.

Constructor & Destructor Documentation

◆ AIManager()

Grail.AIManager.AIManager ( int  threadNumber = 0)
inline

Constructs manager and spawns worker threads defined by parameter. If threadsNumber equals 0, all calculations will be done on main thread.

Parameters
threadNumber

Member Function Documentation

◆ CreateBlackboard()

Blackboard Grail.AIManager.CreateBlackboard ( string  blackboardName)
inline

Constructs blackboard owned by this manager.

Parameters
blackboardName
Returns
constructed blackboard

◆ RegisterAIEntity() [1/2]

void Grail.AIManager.RegisterAIEntity ( AIEntity  entity,
AIEntity  parent,
int  priorityOffset 
)
inline

Managers registers entity with priority worse by priorityOffset than in case of parent entity.

Parameters
entity
parent
priorityOffset

◆ RegisterAIEntity() [2/2]

void Grail.AIManager.RegisterAIEntity ( AIEntity  entity,
int  priority 
)
inline

Manager registers entity with given priority.

Parameters
entity
priority

◆ RemoveAIEntity()

void Grail.AIManager.RemoveAIEntity ( AIEntity  entity)
inline

Manager caches given entity. Later on all cached entities will be unregistered from this manager.

Parameters
entity

◆ SubscribeToBlackboard()

void Grail.AIManager.SubscribeToBlackboard ( string  blackboardName,
AIEntity  entity 
)
inline

Subscribed given entity to blackboard identified by blackboard name and owned by this manager

Parameters
blackboardName
entity

◆ UpdateEntities()

void Grail.AIManager.UpdateEntities ( float  deltaTime)
inline

Updates entities and their assigned behaviors.

Parameters
deltaTime

◆ UpdateReasoners()

void Grail.AIManager.UpdateReasoners ( )
inline

Lets registered entities think by updating their reasoners.


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