UserAgent Class Reference

#include <UserAgent.h>

Collaboration diagram for UserAgent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 UserAgent (Agent *_agent, int _index, Models *_model, Graph *_graph, std::string _meshName, std::string _name)
 ctor
 ~UserAgent ()
 dtor
void update ()
 method to update the user
void draw (ngl::TransformStack *_tx, ngl::Camera *_cam)
 draw the scene
ngl::Vec3 getPos ()
 method to get the position of the agent
ngl::Vec3 getVelocity ()
 method to get the velocity of the user
void setPosition (ngl::Vec3 pos)
 method to set the position of the user
void setVelocity (ngl::Vec3 _vel)
 method to set the velocity of the user
void reset ()
 method to reset the position of the user
std::string getName ()
 method to get the name of the agent
int getNextIndex ()
 method to get the nextIndex
int getIndex ()
 method to get the index
void setIndex (const int _index)
 method to set the index of the user
void setNextIndex (const int _nextIndex)
 method to set the nextIndex of the user
int getPrecision ()
 method to get the precision
UserControlsgetUserControl ()
 method to get user control object
void setScore (const int _score)
 method to set the score of agent
int getScore ()
 method to get the score of the user
void setNoOfBullets (const int _num)
 method to set the no of bullets of the user
int getnoOfBullets ()
 method to get the no of bullets of the user
void shoot ()
 method to shoot the bullets

Public Attributes

bool m_keyPressed
 bool to check if the key pressed

Private Attributes

ngl::Vec3 m_pos
 the position of the agent, this will be represented as pos in the python sctipt
ngl::Vec3 m_dir
 the direction of the agent, this will be represented as dir in the python sctipt
ngl::Vec3 m_velocity
 the speed of the agent, this will be represented as speed in the python sctipt
int m_index
 a variable to hold the index of the node the agent is occupying
int m_nextIndex
 a variable to hold the nextIndex of the node the agent is occupying
std::string m_meshName
 a variable to hold the name of the mesh associated with the agent
ngl::Vec3 m_nextPos
 a variable to hold the next pos to traverse
Agentm_parent
 a pointer to hold the parent agent
Modelsm_model
 a pointer to hold the model
Graphm_graph
 a pointer to hold the graph
int m_precision
 a variable to hold the precision
ngl::Vec3 m_resetPos
 a variable to hold the reset pos to set the pos during reset
ngl::Vec3 m_resetVel
 a variable to hold the reset velocity to set the vel during reset
UserControlsm_userControl
 a pointer to hold the user control
int m_score
 a variable to hold the score of the agent
int m_noOfBullets
 a variable to hold the no of bullets the agent has
std::list< Ammo * > m_ammo
 a list to hold the bullets that the agent handles
std::string m_name
 a variable to hold the name of the agent

Detailed Description

Definition at line 24 of file UserAgent.h.


Constructor & Destructor Documentation

UserAgent::UserAgent ( Agent _agent,
int  _index,
Models _model,
Graph _graph,
std::string  _meshName,
std::string  _name 
)

ctor

Parameters:
[in] the name of the python file to load, this will be stored so the file can be re-loaded.
[in] the parent agent
[in] the initial index of the node where the agent is placed
[in] the models variable
[in] the the meshname associated with the user
[in] the name of the agent
UserAgent::~UserAgent (  ) 

dtor


Member Function Documentation

void UserAgent::draw ( ngl::TransformStack *  _tx,
ngl::Camera *  _cam 
)

draw the scene

Parameters:
[in] _tx the transform stack of the current scene
[in] _cam the current camera
int UserAgent::getIndex (  )  [inline]

method to get the index

Definition at line 88 of file UserAgent.h.

References m_index.

00088 {return m_index;}

std::string UserAgent::getName (  )  [inline]

method to get the name of the agent

Definition at line 80 of file UserAgent.h.

References m_name.

00080 {return m_name;}

int UserAgent::getNextIndex (  )  [inline]

method to get the nextIndex

Definition at line 84 of file UserAgent.h.

References m_nextIndex.

00084 {return m_nextIndex;}

int UserAgent::getnoOfBullets (  )  [inline]

method to get the no of bullets of the user

Definition at line 120 of file UserAgent.h.

References m_noOfBullets.

00120 {return m_noOfBullets;}

ngl::Vec3 UserAgent::getPos (  )  [inline]

method to get the position of the agent

Definition at line 58 of file UserAgent.h.

References m_pos.

00058 {return m_pos;}

int UserAgent::getPrecision (  )  [inline]

method to get the precision

Definition at line 100 of file UserAgent.h.

References m_precision.

00100 {return m_precision;}

int UserAgent::getScore (  )  [inline]

method to get the score of the user

Definition at line 112 of file UserAgent.h.

References m_score.

00112 {return m_score;}

UserControls* UserAgent::getUserControl (  )  [inline]

method to get user control object

Definition at line 104 of file UserAgent.h.

References m_userControl.

00104 {return m_userControl;}

ngl::Vec3 UserAgent::getVelocity (  )  [inline]

method to get the velocity of the user

Definition at line 62 of file UserAgent.h.

References m_velocity.

00062 {return m_velocity;}

void UserAgent::reset (  ) 

method to reset the position of the user

void UserAgent::setIndex ( const int  _index  )  [inline]

method to set the index of the user

Definition at line 92 of file UserAgent.h.

References m_index.

00092 {m_index = _index;}

void UserAgent::setNextIndex ( const int  _nextIndex  )  [inline]

method to set the nextIndex of the user

Definition at line 96 of file UserAgent.h.

References m_nextIndex.

00096 {m_nextIndex = _nextIndex;}

void UserAgent::setNoOfBullets ( const int  _num  )  [inline]

method to set the no of bullets of the user

Definition at line 116 of file UserAgent.h.

References BULLETS, and m_noOfBullets.

00116 {m_noOfBullets += _num*BULLETS;}

void UserAgent::setPosition ( ngl::Vec3  pos  )  [inline]

method to set the position of the user

Parameters:
[in] _pos the new position

Definition at line 67 of file UserAgent.h.

References m_pos.

00067 {m_pos = pos;}

void UserAgent::setScore ( const int  _score  )  [inline]

method to set the score of agent

Definition at line 108 of file UserAgent.h.

References m_score.

00108 {m_score += _score;}

void UserAgent::setVelocity ( ngl::Vec3  _vel  )  [inline]

method to set the velocity of the user

Parameters:
[in] _vel the new velocity

Definition at line 72 of file UserAgent.h.

References m_velocity.

00072 {m_velocity = _vel;}

void UserAgent::shoot (  ) 

method to shoot the bullets

void UserAgent::update (  ) 

method to update the user


Member Data Documentation

std::list<Ammo *> UserAgent::m_ammo [private]

a list to hold the bullets that the agent handles

Definition at line 197 of file UserAgent.h.

ngl::Vec3 UserAgent::m_dir [private]

the direction of the agent, this will be represented as dir in the python sctipt

Definition at line 137 of file UserAgent.h.

a pointer to hold the graph

Definition at line 169 of file UserAgent.h.

int UserAgent::m_index [private]

a variable to hold the index of the node the agent is occupying

Definition at line 145 of file UserAgent.h.

bool to check if the key pressed

Definition at line 128 of file UserAgent.h.

std::string UserAgent::m_meshName [private]

a variable to hold the name of the mesh associated with the agent

Definition at line 153 of file UserAgent.h.

a pointer to hold the model

Definition at line 165 of file UserAgent.h.

std::string UserAgent::m_name [private]

a variable to hold the name of the agent

Definition at line 201 of file UserAgent.h.

int UserAgent::m_nextIndex [private]

a variable to hold the nextIndex of the node the agent is occupying

Definition at line 149 of file UserAgent.h.

ngl::Vec3 UserAgent::m_nextPos [private]

a variable to hold the next pos to traverse

Definition at line 157 of file UserAgent.h.

int UserAgent::m_noOfBullets [private]

a variable to hold the no of bullets the agent has

Definition at line 193 of file UserAgent.h.

a pointer to hold the parent agent

Definition at line 161 of file UserAgent.h.

ngl::Vec3 UserAgent::m_pos [private]

the position of the agent, this will be represented as pos in the python sctipt

Definition at line 133 of file UserAgent.h.

int UserAgent::m_precision [private]

a variable to hold the precision

Definition at line 173 of file UserAgent.h.

ngl::Vec3 UserAgent::m_resetPos [private]

a variable to hold the reset pos to set the pos during reset

Definition at line 177 of file UserAgent.h.

ngl::Vec3 UserAgent::m_resetVel [private]

a variable to hold the reset velocity to set the vel during reset

Definition at line 181 of file UserAgent.h.

int UserAgent::m_score [private]

a variable to hold the score of the agent

Definition at line 189 of file UserAgent.h.

a pointer to hold the user control

Definition at line 185 of file UserAgent.h.

ngl::Vec3 UserAgent::m_velocity [private]

the speed of the agent, this will be represented as speed in the python sctipt

Definition at line 141 of file UserAgent.h.


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

Generated on 16 Aug 2013 for Multi-AgentSystem by  doxygen 1.6.1