Player Class Reference
[Rules]

Base class describing a BB player. More...

#include <Player.hh>

Inheritance diagram for Player:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::vector< enum eSkillSkillList

Public Member Functions

 Player (const MsgPlayerCreate *m)
int getId () const
int getTeamId () const
const CoordinatesgetCoordinates () const
const std::string & getName () const
const std::string & getPositionName () const
int getMa () const
 Get Movement Allowance.
int getMaRemain () const
 Get Movement Allowance Remaining.
int getSt () const
 Get Strenght.
int getAg () const
 Get Agility.
int getAv () const
 Get Armour Value.
enum eStatus getStatus () const
 Get player status.
bool hasPlayed () const
 Check if the player has performed an action this turn.
void setHasPlayed ()
 Set the 'has played this turn' marker.
bool hasBlocked () const
 Check if the player has performed a block during a blitz action.
void setHasBlocked ()
 Set the 'has blocked during this blitz action' marker.
enum eAction getAction () const
 Return the action of this player.
void setAction (enum eAction action)
 Set the action.
bool hasSkill (enum eSkill skill) const
 Check if this player has this skill.
const SkillList & getSkillList () const
 Get the list of skills.
bool hasUsedSkill (enum eSkill skill) const
 Check if this player has used this skill.
void useSkill (enum eSkill skill)
 Mark the skill as used for this turn.
bool hasTackleZone () const
 Check if this player has a tacle zone.
void lostTackleZone ()
 Set the 'has lost his tackle zone' marker with skills like "Bone-head" or "Really Stupid".
void resetTackleZone ()
 Reset the tackle zone marker.
virtual void resetTurn ()
 Called on new turn.

Static Public Member Functions

static const char * stringify (enum eStatus status)
 Get a stringified version of enum eStatus.
static const char * stringify (enum eAction action)
 Get a stringified version of enum eAction.
static const char * stringify (enum eEffort effort)
 Get a stringified version of enum eEffort.
static const char * stringify (enum eSkill skill)
 Get a stringified version of enum eSkill.

Protected Member Functions

virtual void printDebug (std::ostream &os) const

Protected Attributes

int id_
 Player unique identifier.
int team_id_
 Team that this player belongs to (0 or 1).
Coordinates coord_
 Coordinates on the field. Read-only, please.
std::string name_
 Player name.
std::string position_name_
 Player position name (lineman, ...).
enum eStatus status_
 Current player status (standing/prone/Stunned/KO...).
int ma_
int st_
int ag_
int av_
int ma_remain_
bool has_blocked_
bool has_played_
enum eAction action_
bool will_prone_
bool has_tackle_zone_

Friends

std::ostream & operator<< (std::ostream &os, const Player &p)

Detailed Description

Base class describing a BB player.


Member Function Documentation

const Player::SkillList & Player::getSkillList (  )  const [inline]

Get the list of skills.

Note:
Don't use this method in rules, you should better use hasSkill.
enum eStatus Player::getStatus (  )  const [inline]
bool Player::hasSkill ( enum eSkill  skill  )  const [inline]
bool Player::hasUsedSkill ( enum eSkill  skill  )  const [inline]

Check if this player has used this skill.

Parameters:
skill Skill to check for.

Referenced by SPlayer::finishBlockAction(), SPlayer::resolveBlockBothDownAttacker(), and SPlayer::resolveBlockDice().

void Player::lostTackleZone (  )  [inline]

Set the 'has lost his tackle zone' marker with skills like "Bone-head" or "Really Stupid".


The documentation for this class was generated from the following files:
Generated on Mon Apr 5 21:17:44 2010 for Stechec/TBT by  doxygen 1.6.3