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

BallStateAspect Class Reference

#include <ballstateaspect.h>

Inheritance diagram for BallStateAspect:

Inheritance graph
[legend]
Collaboration diagram for BallStateAspect:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BallStateAspect ()
virtual ~BallStateAspect ()
virtual void Update (float deltaTime)
 called during the update of the GameControlServer to allow the ControlAspect to perform any necessary checks.
bool GetLastCollidingAgent (boost::shared_ptr< oxygen::AgentAspect > &agent, TTime &time)
 returns the last agent that collided with the ball and the time when this happened
bool GetBallOnField ()
 returns true if the ball over the playing field
salt::Vector3f GetLastValidBallPosition ()
 returns the last valid position of the ball over the playing field
TTeamIndex GetGoalState ()
 returns the goal in which the balls position is or TI_NONE otherwise
void UpdateLastCollidingAgent (boost::shared_ptr< oxygen::AgentAspect > agent)
 updates the reference to the last agent that collided with the ball

Protected Member Functions

virtual void OnLink ()
 set up the reference to the ball and field collider
virtual void OnUnlink ()
 reset the reference to the ball and field recorder
void UpdateLastCollidingAgent ()
 updates the reference to the last agent that collided with the ball
void UpdateBallOnField ()
 checks if the ball is on the playing field an updates the mBallOnField flag
void UpdateGoalState ()
 checks if the ball is in one of the goals and updates the mGoalState member
void UpdateLastValidBallPos ()
 if the ball has a valid position, i.e.

Protected Attributes

boost::shared_ptr< BallmBall
 reference to the Ball node
boost::shared_ptr< oxygen::RecorderHandlermBallRecorder
 reference to the Ball collision recorder
boost::shared_ptr< oxygen::RecorderHandlermFieldRecorder
 reference to the field collider
boost::shared_ptr< oxygen::RecorderHandlermLeftGoalRecorder
 reference to the left goal recorder
boost::shared_ptr< oxygen::RecorderHandlermRightGoalRecorder
 reference to the right goal recorder
boost::shared_ptr< oxygen::AgentAspectmLastCollidingAgent
 holds a reference to the last agent that collided with the ball
boost::shared_ptr< GameStateAspectmGameState
 holds a reference to the GameStateAspect
TTime mLastAgentCollisionTime
 then time when the last agent collided with the ball
bool mBallOnField
 true if the ball on the soccer field, i.e.
salt::Vector3f mLastValidBallPos
 holds the last valid ball position
TTeamIndex mGoalState
 indicates in which goal the ball is, TI_NONE otherwise

Detailed Description

Definition at line 38 of file ballstateaspect.h.


Constructor & Destructor Documentation

BallStateAspect::BallStateAspect  ) 
 

Definition at line 37 of file ballstateaspect.cpp.

References mBallOnField, mGoalState, mLastAgentCollisionTime, mLastValidBallPos, and TI_NONE.

BallStateAspect::~BallStateAspect  )  [virtual]
 

Definition at line 45 of file ballstateaspect.cpp.


Member Function Documentation

bool BallStateAspect::GetBallOnField  ) 
 

returns true if the ball over the playing field

Definition at line 184 of file ballstateaspect.cpp.

References mBallOnField.

TTeamIndex BallStateAspect::GetGoalState  ) 
 

returns the goal in which the balls position is or TI_NONE otherwise

Definition at line 134 of file ballstateaspect.cpp.

References mGoalState.

bool BallStateAspect::GetLastCollidingAgent boost::shared_ptr< oxygen::AgentAspect > &  agent,
TTime time
 

returns the last agent that collided with the ball and the time when this happened

salt::Vector3f BallStateAspect::GetLastValidBallPosition  ) 
 

returns the last valid position of the ball over the playing field

Definition at line 189 of file ballstateaspect.cpp.

References mLastValidBallPos.

void BallStateAspect::OnLink  )  [protected, virtual]
 

set up the reference to the ball and field collider

Reimplemented from SoccerControlAspect.

Definition at line 158 of file ballstateaspect.cpp.

References SoccerBase::GetBall(), SoccerControlAspect::GetBallRecorder(), oxygen::ControlAspect::GetControlAspect(), SoccerControlAspect::GetFieldRecorder(), SoccerControlAspect::GetLeftGoalRecorder(), SoccerControlAspect::GetRightGoalRecorder(), mBall, mBallRecorder, mFieldRecorder, mGameState, mLeftGoalRecorder, mRightGoalRecorder, and SoccerControlAspect::OnLink().

Here is the call graph for this function:

void BallStateAspect::OnUnlink  )  [protected, virtual]
 

reset the reference to the ball and field recorder

Reimplemented from zeitgeist::Leaf.

Definition at line 172 of file ballstateaspect.cpp.

References mBallRecorder, mFieldRecorder, mGameState, mLastCollidingAgent, mLeftGoalRecorder, mRightGoalRecorder, and zeitgeist::Leaf::OnUnlink().

Here is the call graph for this function:

void BallStateAspect::Update float  deltaTime  )  [virtual]
 

called during the update of the GameControlServer to allow the ControlAspect to perform any necessary checks.

Implements oxygen::ControlAspect.

Definition at line 139 of file ballstateaspect.cpp.

References mBall, mBallRecorder, mFieldRecorder, mLeftGoalRecorder, mRightGoalRecorder, UpdateBallOnField(), UpdateGoalState(), UpdateLastCollidingAgent(), and UpdateLastValidBallPos().

Here is the call graph for this function:

void BallStateAspect::UpdateBallOnField  )  [protected]
 

checks if the ball is on the playing field an updates the mBallOnField flag

Definition at line 84 of file ballstateaspect.cpp.

References mBallOnField, and mFieldRecorder.

Referenced by Update().

void BallStateAspect::UpdateGoalState  )  [protected]
 

checks if the ball is in one of the goals and updates the mGoalState member

Definition at line 108 of file ballstateaspect.cpp.

References mGoalState, mLeftGoalRecorder, mRightGoalRecorder, TI_LEFT, TI_NONE, and TI_RIGHT.

Referenced by Update().

void BallStateAspect::UpdateLastCollidingAgent  )  [protected]
 

updates the reference to the last agent that collided with the ball

Definition at line 58 of file ballstateaspect.cpp.

References mBallRecorder, mGameState, mLastAgentCollisionTime, and mLastCollidingAgent.

Referenced by Update().

void BallStateAspect::UpdateLastCollidingAgent boost::shared_ptr< oxygen::AgentAspect agent  ) 
 

updates the reference to the last agent that collided with the ball

Definition at line 78 of file ballstateaspect.cpp.

References mGameState, mLastAgentCollisionTime, and mLastCollidingAgent.

void BallStateAspect::UpdateLastValidBallPos  )  [protected]
 

if the ball has a valid position, i.e.

is on the field, remember it

Definition at line 98 of file ballstateaspect.cpp.

References mBall, mBallOnField, and mLastValidBallPos.

Referenced by Update().


Member Data Documentation

boost::shared_ptr<Ball> BallStateAspect::mBall [protected]
 

reference to the Ball node

Definition at line 98 of file ballstateaspect.h.

Referenced by OnLink(), Update(), and UpdateLastValidBallPos().

bool BallStateAspect::mBallOnField [protected]
 

true if the ball on the soccer field, i.e.

not on the border surrounding the soccer field

Definition at line 124 of file ballstateaspect.h.

Referenced by BallStateAspect(), GetBallOnField(), UpdateBallOnField(), and UpdateLastValidBallPos().

boost::shared_ptr<oxygen::RecorderHandler> BallStateAspect::mBallRecorder [protected]
 

reference to the Ball collision recorder

Definition at line 101 of file ballstateaspect.h.

Referenced by OnLink(), OnUnlink(), Update(), and UpdateLastCollidingAgent().

boost::shared_ptr<oxygen::RecorderHandler> BallStateAspect::mFieldRecorder [protected]
 

reference to the field collider

Definition at line 104 of file ballstateaspect.h.

Referenced by OnLink(), OnUnlink(), Update(), and UpdateBallOnField().

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

holds a reference to the GameStateAspect

Definition at line 117 of file ballstateaspect.h.

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

TTeamIndex BallStateAspect::mGoalState [protected]
 

indicates in which goal the ball is, TI_NONE otherwise

Definition at line 130 of file ballstateaspect.h.

Referenced by BallStateAspect(), GetGoalState(), and UpdateGoalState().

TTime BallStateAspect::mLastAgentCollisionTime [protected]
 

then time when the last agent collided with the ball

Definition at line 120 of file ballstateaspect.h.

Referenced by BallStateAspect(), and UpdateLastCollidingAgent().

boost::shared_ptr<oxygen::AgentAspect> BallStateAspect::mLastCollidingAgent [protected]
 

holds a reference to the last agent that collided with the ball

Definition at line 114 of file ballstateaspect.h.

Referenced by OnUnlink(), and UpdateLastCollidingAgent().

salt::Vector3f BallStateAspect::mLastValidBallPos [protected]
 

holds the last valid ball position

Definition at line 127 of file ballstateaspect.h.

Referenced by BallStateAspect(), GetLastValidBallPosition(), and UpdateLastValidBallPos().

boost::shared_ptr<oxygen::RecorderHandler> BallStateAspect::mLeftGoalRecorder [protected]
 

reference to the left goal recorder

Definition at line 107 of file ballstateaspect.h.

Referenced by OnLink(), OnUnlink(), Update(), and UpdateGoalState().

boost::shared_ptr<oxygen::RecorderHandler> BallStateAspect::mRightGoalRecorder [protected]
 

reference to the right goal recorder

Definition at line 110 of file ballstateaspect.h.

Referenced by OnLink(), OnUnlink(), Update(), and UpdateGoalState().


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