overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Member Functions | Static Public Member Functions
gameplay::AIAgent Class Reference

#include <AIAgent.h>

Inheritance diagram for gameplay::AIAgent:
gameplay::Ref

List of all members.

Classes

class  Listener

Public Member Functions

const char * getId () const
NodegetNode () const
AIStateMachinegetStateMachine ()
bool isEnabled () const
void setEnabled (bool enabled)
void setListener (Listener *listener)

Static Public Member Functions

static AIAgentcreate ()

Detailed Description

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.


Member Function Documentation

static AIAgent* gameplay::AIAgent::create ( ) [static]

Creates a new AIAgent.

Returns:
A new AIAgent.
const char* gameplay::AIAgent::getId ( ) const

Returns the identifier for the AIAgent.

This method simply returns the ID of the Node which this AIAgent is bound to. If this AIAgent is not bound to a Node, this method returns an empty string.

Returns:
The identifier for the agent.

Returns the Node this AIAgent is assigned to.

Returns:
The Node this agent is assigned to.

Returns the state machine for the AIAgent.

Returns:
The agent's state machine.

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.

Returns:
true if the agent is enabled, false otherwise.
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.

Parameters:
enabledtrue if the AIAgent should be enabled, false otherwise.

Sets an event listener for this AIAgent.

Parameters:
listenerThe new AIAgent listener, or NULL to remove any existing listener.
 All Classes Functions Variables Typedefs Enumerations Enumerator