Manages registered entities and shared blackboards.
More...
|
| AIManager (int threadNumber=0) |
| Constructs a manager and spawns worker threads defined by the parameter. If threadsNumber equals 0, all calculations will be done on the main thread. More...
|
|
void | Dispose () |
|
void | RegisterAIEntity (AIEntity entity, int priority) |
| Manager registers entity with given priority. As a result entities and their behaviors will be updated when UpdateEntities is called. Also entities will think when UpdateReasoners is called. Entities with lower priority will be updated first. More...
|
|
void | RegisterEntityGroup (EntityGroup entityGroup, int priority) |
| Manager registers an entity group (and its entities) with the given priority. As a result entities and their behaviors will be updated when UpdateEntities is called. Also entities will think when UpdateReasoners is called. Entities with lower priority will be updated first. Resulting priority of each entity in group is calculated by adding group priority and relative priority of a given entity. More...
|
|
void | RemoveEntityGroup (EntityGroup entityGroup) |
| Manager removes entity group and caches its entities for removal. Later on all cached entities will be unregistered from this manager. Unregistered entities will no longer be updated, neither will be their behaviors and reasoners. More...
|
|
void | RemoveAIEntity (AIEntity entity) |
| Manager caches given entity. Later on all cached entities will be unregistered from this manager. Unregistered entities will no longer be updated, neither will be their behaviors and reasoners. 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) |
| Registers an entity change observer that will be notified via OnEntityAdded and OnEntityRemoved functions when an entity is added or removed from the manager. More...
|
|
void | RemoveEntityChangeObserver (IEntityChangeObserver observer) |
| Removes an entity change observer so it no longer be notified on adding or removing an entity from the manager. More...
|
|
bool | ContainsEntity (AIEntity entity) |
| Checks if a given entity is registered in the manager. More...
|
|
|
List<(AIEntity entity, int priority)> | Entities => entities |
|
Dictionary< string, Blackboard > | SharedBlackboards => sharedBlackboards |
|
Manages registered entities and shared blackboards.
◆ AIManager()
Grail.Core.AIManager.AIManager |
( |
int |
threadNumber = 0 | ) |
|
|
inline |
Constructs a manager and spawns worker threads defined by the parameter. If threadsNumber equals 0, all calculations will be done on the main thread.
- Parameters
-
◆ ContainsEntity()
bool Grail.Core.AIManager.ContainsEntity |
( |
AIEntity |
entity | ) |
|
|
inline |
Checks if a given entity is registered in the manager.
- Parameters
-
- Returns
- true if entity is registered in manager, false otherwise.
◆ CreateBlackboard()
Blackboard Grail.Core.AIManager.CreateBlackboard |
( |
string |
blackboardName | ) |
|
|
inline |
Constructs blackboard owned by this manager.
- Parameters
-
- Returns
- constructed blackboard
◆ RegisterAIEntity()
void Grail.Core.AIManager.RegisterAIEntity |
( |
AIEntity |
entity, |
|
|
int |
priority |
|
) |
| |
|
inline |
Manager registers entity with given priority. As a result entities and their behaviors will be updated when UpdateEntities is called. Also entities will think when UpdateReasoners is called. Entities with lower priority will be updated first.
- Parameters
-
◆ RegisterEntityChangeObserver()
Registers an entity change observer that will be notified via OnEntityAdded and OnEntityRemoved functions when an entity is added or removed from the manager.
- Parameters
-
◆ RegisterEntityGroup()
void Grail.Core.AIManager.RegisterEntityGroup |
( |
EntityGroup |
entityGroup, |
|
|
int |
priority |
|
) |
| |
|
inline |
Manager registers an entity group (and its entities) with the given priority. As a result entities and their behaviors will be updated when UpdateEntities is called. Also entities will think when UpdateReasoners is called. Entities with lower priority will be updated first. Resulting priority of each entity in group is calculated by adding group priority and relative priority of a given entity.
- Parameters
-
◆ RemoveAIEntity()
void Grail.Core.AIManager.RemoveAIEntity |
( |
AIEntity |
entity | ) |
|
|
inline |
Manager caches given entity. Later on all cached entities will be unregistered from this manager. Unregistered entities will no longer be updated, neither will be their behaviors and reasoners.
- Parameters
-
◆ RemoveEntityChangeObserver()
Removes an entity change observer so it no longer be notified on adding or removing an entity from the manager.
- Parameters
-
◆ RemoveEntityGroup()
void Grail.Core.AIManager.RemoveEntityGroup |
( |
EntityGroup |
entityGroup | ) |
|
|
inline |
Manager removes entity group and caches its entities for removal. Later on all cached entities will be unregistered from this manager. Unregistered entities will no longer be updated, neither will be their behaviors and reasoners.
- Parameters
-
◆ SubscribeToBlackboard()
void Grail.Core.AIManager.SubscribeToBlackboard |
( |
string |
blackboardName, |
|
|
AIEntity |
entity |
|
) |
| |
|
inline |
Subscribed given entity to blackboard identified by blackboard name and owned by this manager
- Parameters
-
◆ UpdateEntities()
void Grail.Core.AIManager.UpdateEntities |
( |
float |
deltaTime | ) |
|
|
inline |
Updates entities and their assigned behaviors.
- Parameters
-
◆ UpdateReasoners()
void Grail.Core.AIManager.UpdateReasoners |
( |
| ) |
|
|
inline |
Lets registered entities think by updating their reasoners.
The documentation for this class was generated from the following file:
- GrailCore/source/AIManager.cs