Parameter T: Player type (CPlayer or SPlayer). More...
#include <Field.hh>
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] |
Parameter T: Player type (CPlayer or SPlayer).
| 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.
| team_id | The team id of the team that tackles. (ie: The opposing team). | |
| pos | Position in field to look for. |
Place a player on the field.
1.4.7