CBomberMove Class Reference

This class manages the moves of a bomber. More...

#include <CBomberMove.h>

Collaboration diagram for CBomberMove:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CBomberMove (void)
 Constructor.
 ~CBomberMove (void)
 Destructor.
void Create (int BlockX, int BlockY, int Player)
 Initialize the object.
void Destroy (void)
 Free any memory allocated by this object.
void Update (float DeltaTime)
 Make the bomber move according to the bomber move command it received.
void WriteSnapshot (CArenaSnapshot &Snapshot)
void ReadSnapshot (CArenaSnapshot &Snapshot)
void Command (EBomberMove BomberMove)
 Give a move order to the bomber for next update.
void SetArena (CArena *pArena)
 Set the arena to use.
int GetBlockX (void)
 Return the block position X of the bomber.
int GetBlockY (void)
 Return the block position Y of the bomber.
int GetX (void)
 Get the integer X position (in pixels) of the bomber in the arena.
int GetY (void)
 Get the integer Y position (in pixels) of the bomber in the arena.
bool CouldMove (void)
 Return whether the bomber could move the last time he tried.
EBomberMove GetMove (void)
 Return the current move order the bomber has to perform.
EBomberMove GetLastRealMove (void)
 Return the direction where the bomber was going the last time he really moved.

Private Member Functions

bool TryMove (float fPixels)
 Make the bomber move in the current direction (bomber move) and return if he could move.
ETurning TurnTest (EBomberMove TestMove)
 Return what would be the turning state if we tried moving in the specified direction (bomber move).
ECanMove CanMove (EBomberMove TestMove)
 Return the appropriate ECanMove value when trying to go in the current direction (bomber move). This is a virtual test.
bool IsObstacle (int X, int Y)
 Return whether there is a wall or a bomb on the specified block.

Private Attributes

CArenam_pArena
 Arena where to check for obstacles.
int m_Player
 Player number of the parent bomber. -1 when not initialized.
float m_X
 Float position X in arena (in pixels) from the top left corner of the arena.
float m_Y
 Float position Y in arena (in pixels) from the top left corner of the arena.
int m_iX
 Integer position X in arena (in pixels) from the top left corner of the arena.
int m_iY
 Integer position Y in arena (in pixels) from the top left corner of the arena.
int m_BlockX
 Position X in the arena grid (in blocks).
int m_BlockY
 Position Y in the arena grid (in blocks).
EBomberMove m_BomberMove
 Describes the move that the owner player currently wants the bomber to perform.
EBomberMove m_LastRealBomberMove
 Describes the last "real" (ie. not BOMBERMOVE_NONE) move the owner player wanted the bomber to perform.
ETurning m_Turning
 Is the bomber turning around a wall and how.
bool m_CouldMove
 Could the bomber move the last time he tried? (used for Inertia sickness).


Detailed Description

This class manages the moves of a bomber.

Constructor & Destructor Documentation

CBomberMove::CBomberMove ( void   ) 

Constructor.

CBomberMove::~CBomberMove ( void   ) 

Destructor.


Member Function Documentation

bool CBomberMove::TryMove ( float  fPixels  )  [private]

Make the bomber move in the current direction (bomber move) and return if he could move.

Here is the call graph for this function:

Here is the caller graph for this function:

ETurning CBomberMove::TurnTest ( EBomberMove  TestMove  )  [private]

Return what would be the turning state if we tried moving in the specified direction (bomber move).

Here is the call graph for this function:

Here is the caller graph for this function:

ECanMove CBomberMove::CanMove ( EBomberMove  TestMove  )  [private]

Return the appropriate ECanMove value when trying to go in the current direction (bomber move). This is a virtual test.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CBomberMove::IsObstacle ( int  X,
int  Y 
) [private]

Return whether there is a wall or a bomb on the specified block.

void CBomberMove::Create ( int  BlockX,
int  BlockY,
int  Player 
)

Initialize the object.

Here is the call graph for this function:

Here is the caller graph for this function:

void CBomberMove::Destroy ( void   ) 

Free any memory allocated by this object.

Here is the caller graph for this function:

void CBomberMove::Update ( float  DeltaTime  ) 

Make the bomber move according to the bomber move command it received.

Here is the call graph for this function:

Here is the caller graph for this function:

void CBomberMove::WriteSnapshot ( CArenaSnapshot Snapshot  ) 

Here is the call graph for this function:

Here is the caller graph for this function:

void CBomberMove::ReadSnapshot ( CArenaSnapshot Snapshot  ) 

Here is the call graph for this function:

Here is the caller graph for this function:

void CBomberMove::Command ( EBomberMove  BomberMove  ) 

Give a move order to the bomber for next update.

Here is the call graph for this function:

Here is the caller graph for this function:

void CBomberMove::SetArena ( CArena pArena  )  [inline]

Set the arena to use.

Here is the caller graph for this function:

int CBomberMove::GetBlockX ( void   )  [inline]

Return the block position X of the bomber.

Here is the caller graph for this function:

int CBomberMove::GetBlockY ( void   )  [inline]

Return the block position Y of the bomber.

Here is the caller graph for this function:

int CBomberMove::GetX ( void   )  [inline]

Get the integer X position (in pixels) of the bomber in the arena.

Here is the caller graph for this function:

int CBomberMove::GetY ( void   )  [inline]

Get the integer Y position (in pixels) of the bomber in the arena.

Here is the caller graph for this function:

bool CBomberMove::CouldMove ( void   )  [inline]

Return whether the bomber could move the last time he tried.

Here is the caller graph for this function:

EBomberMove CBomberMove::GetMove ( void   )  [inline]

Return the current move order the bomber has to perform.

Here is the caller graph for this function:

EBomberMove CBomberMove::GetLastRealMove ( void   )  [inline]

Return the direction where the bomber was going the last time he really moved.

Here is the caller graph for this function:


Member Data Documentation

Arena where to check for obstacles.

int CBomberMove::m_Player [private]

Player number of the parent bomber. -1 when not initialized.

float CBomberMove::m_X [private]

Float position X in arena (in pixels) from the top left corner of the arena.

float CBomberMove::m_Y [private]

Float position Y in arena (in pixels) from the top left corner of the arena.

int CBomberMove::m_iX [private]

Integer position X in arena (in pixels) from the top left corner of the arena.

int CBomberMove::m_iY [private]

Integer position Y in arena (in pixels) from the top left corner of the arena.

int CBomberMove::m_BlockX [private]

Position X in the arena grid (in blocks).

int CBomberMove::m_BlockY [private]

Position Y in the arena grid (in blocks).

Describes the move that the owner player currently wants the bomber to perform.

Describes the last "real" (ie. not BOMBERMOVE_NONE) move the owner player wanted the bomber to perform.

Is the bomber turning around a wall and how.

bool CBomberMove::m_CouldMove [private]

Could the bomber move the last time he tried? (used for Inertia sickness).


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

Generated on Sat Oct 18 12:26:43 2008 for Bombermaaan by  doxygen 1.5.5
Visit the Bombermaaan project page
SourceForge.net Logo