Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

GameStatePerceptor Class Reference

#include <gamestateperceptor.h>

Inheritance diagram for GameStatePerceptor:

Inheritance graph
[legend]
Collaboration diagram for GameStatePerceptor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GameStatePerceptor ()
virtual ~GameStatePerceptor ()
virtual bool Percept (boost::shared_ptr< oxygen::PredicateList > predList)

Protected Member Functions

virtual void OnLink ()
 sets up the reference to the GameStateAspect
virtual void OnUnlink ()
 resets the reference to the GameStateAspect
void InsertInitialPercept (oxygen::Predicate &predicate)
 inserts predicate parameters the agent receives once after a successful init command into the predicate.
void InsertSoccerParam (oxygen::Predicate &predicate, const std::string &name)
 inserts a soccer variable and its current value into the predicate

Protected Attributes

boost::shared_ptr< GameStateAspectmGameState
 a reference to the game state
boost::shared_ptr< AgentStatemAgentState
 a reference to the agentstate
bool mFirstPercept
 true until Percept() is called the first time after the agent is assigned to a team with a successful init command

Detailed Description

Definition at line 36 of file gamestateperceptor.h.


Constructor & Destructor Documentation

GameStatePerceptor::GameStatePerceptor  ) 
 

Definition at line 33 of file gamestateperceptor.cpp.

References mFirstPercept.

GameStatePerceptor::~GameStatePerceptor  )  [virtual]
 

Definition at line 38 of file gamestateperceptor.cpp.


Member Function Documentation

void GameStatePerceptor::InsertInitialPercept oxygen::Predicate predicate  )  [protected]
 

inserts predicate parameters the agent receives once after a successful init command into the predicate.

These are it's uniform number and team as well as a subset of the soccer variables

Definition at line 57 of file gamestateperceptor.cpp.

References zeitgeist::ParameterList::AddList(), zeitgeist::ParameterList::AddValue(), InsertSoccerParam(), mAgentState, oxygen::Predicate::parameter, TI_LEFT, TI_NONE, and TI_RIGHT.

Referenced by Percept().

Here is the call graph for this function:

void GameStatePerceptor::InsertSoccerParam oxygen::Predicate predicate,
const std::string &  name
[protected]
 

inserts a soccer variable and its current value into the predicate

Definition at line 43 of file gamestateperceptor.cpp.

References zeitgeist::ParameterList::AddList(), zeitgeist::ParameterList::AddValue(), SoccerBase::GetSoccerVar(), and oxygen::Predicate::parameter.

Referenced by InsertInitialPercept().

Here is the call graph for this function:

void GameStatePerceptor::OnLink  )  [protected, virtual]
 

sets up the reference to the GameStateAspect

Reimplemented from zeitgeist::Leaf.

Definition at line 144 of file gamestateperceptor.cpp.

References SoccerBase::GetAgentState(), SoccerBase::GetGameState(), mAgentState, and mGameState.

Here is the call graph for this function:

void GameStatePerceptor::OnUnlink  )  [protected, virtual]
 

resets the reference to the GameStateAspect

Reimplemented from zeitgeist::Leaf.

Definition at line 151 of file gamestateperceptor.cpp.

References mAgentState, and mGameState.

bool GameStatePerceptor::Percept boost::shared_ptr< oxygen::PredicateList predList  )  [virtual]
 

Returns:
true, if valid data is available and false otherwise.

Implements oxygen::Perceptor.

Definition at line 104 of file gamestateperceptor.cpp.

References zeitgeist::ParameterList::AddList(), zeitgeist::ParameterList::AddValue(), zeitgeist::ParameterList::Clear(), InsertInitialPercept(), mAgentState, mFirstPercept, mGameState, oxygen::Predicate::name, oxygen::Predicate::parameter, SoccerBase::PlayMode2Str(), and TI_NONE.

Here is the call graph for this function:


Member Data Documentation

boost::shared_ptr<AgentState> GameStatePerceptor::mAgentState [protected]
 

a reference to the agentstate

Definition at line 70 of file gamestateperceptor.h.

Referenced by InsertInitialPercept(), OnLink(), OnUnlink(), and Percept().

bool GameStatePerceptor::mFirstPercept [protected]
 

true until Percept() is called the first time after the agent is assigned to a team with a successful init command

Definition at line 75 of file gamestateperceptor.h.

Referenced by GameStatePerceptor(), and Percept().

boost::shared_ptr<GameStateAspect> GameStatePerceptor::mGameState [protected]
 

a reference to the game state

Definition at line 67 of file gamestateperceptor.h.

Referenced by OnLink(), OnUnlink(), and Percept().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:38:32 2006 for rcssserver3d by  doxygen 1.4.4