AI Class. More...
#include <deAI.h>
Public Member Functions | |
Constructors and Destructors | |
| deAI (deAIManager *manager) | |
| Creates a new ai object. | |
| virtual | ~deAI () |
| Cleans up the ai. | |
Management | |
| deAINode * | GetRootNode () const |
| Retrieves the root node or NULL. | |
| void | SetRootNode (deAINode *node) |
| Sets the root node or NULL. | |
| void | Process () |
| Process ai. | |
| void | ProcessWithEvent (int event) |
| Process ai with an event. | |
| void | NotifyNodeChanged (deAINode *node) |
| Notifies that a node changed. | |
Controllers | |
| int | GetControllerCount () const |
| Retrieves the count of controllers. | |
| deAIController * | GetControllerAt (int index) const |
| Retrieves the controller at the given index. | |
| int | IndexOfController (deAIController *controller) const |
| Retrieves the index of the given controller or -1 if not found. | |
| bool | HasController (deAIController *controller) const |
| Determines if the given controller exists. | |
| void | AddController (deAIController *controller) |
| Adds a controller. | |
| void | RemoveController (deAIController *controller) |
| Removes the given controller. | |
| void | RemoveAllControllers () |
| Removes all controllers. | |
| void | NotifyControllerChangedAt (int index) |
| Notifies that the controller at the given index changed. | |
System Peers | |
| deBaseAIAI * | GetAIAI () const |
| Retrieves the ai system peer object. | |
| void | SetAIAI (deBaseAIAI *aiAI) |
| Sets the ai system peer object. | |
| deBaseScriptingAI * | GetScriptingAI () const |
| Retrieves the scripting system peer object. | |
| void | SetScriptingAI (deBaseScriptingAI *scrAI) |
| Sets the scripting system peer object. | |
AI Class.
AI object provide artificial intelligence support to the game. The AI is organized in a tree like fashion with nodes carrying out actions, delegating actions to other nodes or merging actions. To control the nodes controllers can be defined which are fed with values from the game. Furthermore events can be send to the AI object to trigger new events. Nodes can send events to the game to trigger actions themselves. Furthermore the structure of the tree can be changed any time to alter the AI on the fly. Care has to be taken though to not cause event loops.
| deAI::deAI | ( | deAIManager * | manager ) |
Creates a new ai object.
| virtual deAI::~deAI | ( | ) | [virtual] |
Cleans up the ai.
| void deAI::AddController | ( | deAIController * | controller ) |
Adds a controller.
| deBaseAIAI* deAI::GetAIAI | ( | ) | const [inline] |
Retrieves the ai system peer object.
| deAIController* deAI::GetControllerAt | ( | int | index ) | const |
Retrieves the controller at the given index.
| int deAI::GetControllerCount | ( | ) | const [inline] |
Retrieves the count of controllers.
| deAINode* deAI::GetRootNode | ( | ) | const [inline] |
Retrieves the root node or NULL.
| deBaseScriptingAI* deAI::GetScriptingAI | ( | ) | const [inline] |
Retrieves the scripting system peer object.
| bool deAI::HasController | ( | deAIController * | controller ) | const |
Determines if the given controller exists.
| int deAI::IndexOfController | ( | deAIController * | controller ) | const |
Retrieves the index of the given controller or -1 if not found.
| void deAI::NotifyControllerChangedAt | ( | int | index ) |
Notifies that the controller at the given index changed.
| void deAI::NotifyNodeChanged | ( | deAINode * | node ) |
Notifies that a node changed.
| void deAI::Process | ( | ) |
Process ai.
| void deAI::ProcessWithEvent | ( | int | event ) |
Process ai with an event.
| void deAI::RemoveAllControllers | ( | ) |
Removes all controllers.
| void deAI::RemoveController | ( | deAIController * | controller ) |
Removes the given controller.
| void deAI::SetAIAI | ( | deBaseAIAI * | aiAI ) |
Sets the ai system peer object.
| void deAI::SetRootNode | ( | deAINode * | node ) |
Sets the root node or NULL.
| void deAI::SetScriptingAI | ( | deBaseScriptingAI * | scrAI ) |
Sets the scripting system peer object.
1.7.2