Field< T > Class Template Reference
[Rules]

Game playing ground.

Parameter T: Player type (CPlayer or SPlayer). More...

#include <Field.hh>

List of all members.

Public Member Functions

bool intoField (const Position &pos) const
 Check if the specified coordinate are in the field zone (ie: not outside the border).
Position dirToPos (enum eDirection dir) const
 Convert a cardinal point direction to a Position.
void setPlayer (const Position &pos, T *p)
 Place a player on the field.
T * getPlayer (const Position &pos) const
 Get the player at the specified position, or NULL.
int isPlacementValid (int team_id) const
 Check if the placement of the team is valid.
bool hasAdjacentEmptySquare (const Position &pos) const
 Check if there is an empty square near the given position.
PosList getAdjacentEmptySquares (const Position &pos) const
 Get the players surrounding the given position.
bool hasAdjacentPlayer (const Position &pos) const
 Check if there is a player near the given position.
bool hasAdjacentPlayer (const Position &pos, enum eStatus s, int team_id) const
 Check if there is a player of the specified team near the given position.
std::vector< T * > getAdjacentPlayers (const Position &pos) const
 Get the players surrounding the given position.
std::vector< T * > getAdjacentPlayers (const Position &pos, enum eStatus s, int team_id) const
 Get the players of the specified team surrounding the given position.
int getNbTackleZones (int team_id, const Position &pos) const
 Get the number of tackle zones for the square made by a team.

Protected Attributes

T * tab_ [COLS *ROWS]


Detailed Description

template<typename T>
class Field< T >

Game playing ground.

Parameter T: Player type (CPlayer or SPlayer).


Member Function Documentation

template<typename T>
int Field< T >::getNbTackleZones ( int  team_id,
const Position pos 
) const [inline]

Get the number of tackle zones for the square made by a team.

Parameters:
team_id The team id of the team that tackles. (ie: The opposing team).
pos Position in field to look for.

template<typename T>
void Field< T >::setPlayer ( const Position pos,
T *  p 
) [inline]

Place a player on the field.

Note:
Don't forget to manually set NULL its previous position.


The documentation for this class was generated from the following files:
Generated on Sat Jun 23 16:10:35 2007 for Stechec/TBT by  doxygen 1.4.7