#include <AIAgent.h>
Classes | |
class | Listener |
Public Member Functions | |
const char * | getId () const |
Node * | getNode () const |
AIStateMachine * | getStateMachine () |
bool | isEnabled () const |
void | setEnabled (bool enabled) |
void | setListener (Listener *listener) |
Static Public Member Functions | |
static AIAgent * | create () |
Defines an AI agent that can be added to nodes in a scene.
Agents represent a unit of intelligence in a game and can be used to program logic for a character or object in a game, using constructs such as state machines. By default, an AIAgent has an empty state machine.
static AIAgent* gameplay::AIAgent::create | ( | ) | [static] |
const char* gameplay::AIAgent::getId | ( | ) | const |
Node* gameplay::AIAgent::getNode | ( | ) | const |
Returns the state machine for the AIAgent.
bool gameplay::AIAgent::isEnabled | ( | ) | const |
Determines if this AIAgent is currently enabled.
Agents are always disabled until they have been associated with a valid Node though Node::setAgent(AIAgent*). In addition, an AIAgent can be explicitly enabled or disabled using the setEnabled(bool) method.
void gameplay::AIAgent::setEnabled | ( | bool | enabled | ) |
Sets whether this AIAgent is enabled.
By default, AIAgents are enabled and they can receive messages and state changes. When disabled, AIAgents stop receiving messages and their state machines are halted until they are re-enabled.
enabled | true if the AIAgent should be enabled, false otherwise. |
void gameplay::AIAgent::setListener | ( | Listener * | listener | ) |