Drag[en]gine Game Engine  1.0
deAI Class Reference

AI Class. More...

#include <deAI.h>

Inheritance diagram for deAI:
deResource deObject

Public Member Functions

deAINodeGetRootNode () const
void SetRootNode (deAINode *node)
void Process ()
void ProcessWithEvent (int event)
void NotifyNodeChanged (deAINode *node)
int GetControllerCount () const
deAIControllerGetControllerAt (int index) const
int IndexOfController (deAIController *controller) const
bool HasController (deAIController *controller) const
void AddController (deAIController *controller)
void RemoveController (deAIController *controller)
void RemoveAllControllers ()
void NotifyControllerChangedAt (int index)
System Peers
deBaseAIAIGetAIAI () const
void SetAIAI (deBaseAIAI *aiAI)
deBaseScriptingAIGetScriptingAI () const
void SetScriptingAI (deBaseScriptingAI *scrAI)
- Public Member Functions inherited from deResource
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
deEngineGetEngine () const
 Game engine object from resource manager. More...
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
void MarkLeaking ()
 Marks the resource leaking. More...
 deResource (deResourceManager *resourceManager)
 Create resource. More...
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
void AddReference ()
 Add reference increasing reference count by 1. More...
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 deObject ()
 Create object with reference count of 1. More...

Constructors and Destructors

 deAI (deAIManager *manager)
virtual ~deAI ()
 Clean up ai. More...

Additional Inherited Members

- Protected Member Functions inherited from deResource
virtual ~deResource ()
 Clean up resource. More...
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...

Detailed Description

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.

Pl├╝ss Roland

Constructor & Destructor Documentation

◆ deAI()

deAI::deAI ( deAIManager manager)

Creates a new ai object.

◆ ~deAI()

virtual deAI::~deAI ( )

Clean up ai.

Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ AddController()

void deAI::AddController ( deAIController controller)

Adds a controller.

Referenced by GetControllerCount().

◆ GetAIAI()

deBaseAIAI* deAI::GetAIAI ( ) const

Retrieves the ai system peer object.

References SetAIAI().

◆ GetControllerAt()

deAIController* deAI::GetControllerAt ( int  index) const

Retrieves the controller at the given index.

Referenced by GetControllerCount().

◆ GetControllerCount()

int deAI::GetControllerCount ( ) const

◆ GetRootNode()

deAINode* deAI::GetRootNode ( ) const

Retrieves the root node or NULL.

References NotifyNodeChanged(), Process(), ProcessWithEvent(), and SetRootNode().

◆ GetScriptingAI()

deBaseScriptingAI* deAI::GetScriptingAI ( ) const

Retrieves the scripting system peer object.

References SetScriptingAI().

◆ HasController()

bool deAI::HasController ( deAIController controller) const

Determines if the given controller exists.

Referenced by GetControllerCount().

◆ IndexOfController()

int deAI::IndexOfController ( deAIController controller) const

Retrieves the index of the given controller or -1 if not found.

Referenced by GetControllerCount().

◆ NotifyControllerChangedAt()

void deAI::NotifyControllerChangedAt ( int  index)

Notifies that the controller at the given index changed.

Referenced by GetControllerCount().

◆ NotifyNodeChanged()

void deAI::NotifyNodeChanged ( deAINode node)

Notifies that a node changed.

Referenced by GetRootNode().

◆ Process()

void deAI::Process ( )

Process ai.

Referenced by GetRootNode().

◆ ProcessWithEvent()

void deAI::ProcessWithEvent ( int  event)

Process ai with an event.

Referenced by GetRootNode().

◆ RemoveAllControllers()

void deAI::RemoveAllControllers ( )

Removes all controllers.

Referenced by GetControllerCount().

◆ RemoveController()

void deAI::RemoveController ( deAIController controller)

Removes the given controller.

Referenced by GetControllerCount().

◆ SetAIAI()

void deAI::SetAIAI ( deBaseAIAI aiAI)

Sets the ai system peer object.

Referenced by GetAIAI().

◆ SetRootNode()

void deAI::SetRootNode ( deAINode node)

Sets the root node or NULL.

Referenced by GetRootNode().

◆ SetScriptingAI()

void deAI::SetScriptingAI ( deBaseScriptingAI scrAI)

Sets the scripting system peer object.

Referenced by GetScriptingAI().

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