Player Struct 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
eSkill
SkillList

Public Member Functions

 Player (const MsgPlayerCreate *m)
int getId () const
int getTeamId () const
const PositiongetPosition () 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 eDeclaredAction getAction () const
 Return the action of this player.
void setAction (enum eDeclaredAction 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.
void resetTurn ()
 Called on new turn.
 Player (Team *team)
void reset ()
TeamgetTeam ()
const char * getName ()
void setName (const char *name)
const char * getPositionTitle ()
void setPosition (const char *posistionTitle)
PositiongetPosition ()
int getMovementAllowance ()
void setMovementAllowance (int ma)
int getStrength ()
void setStrength (int st)
int getAgility ()
void setAgility (int ag)
int getArmourValue ()
void setArmourValue (int av)
std::vector< const char * > getSkills ()
 Return all player's skills : normal + double.
std::vector< const char * > getSkillsNormal ()
std::vector< const char * > getSkillsDouble ()
void removeAllSkillsNormal ()
void removeAllSkillsDouble ()
void addSkillNormal (const char *skill)
 Used to add a new skill for the player other than the skill from his position.
void addSkillDouble (const char *skill)
 Used to add a new skill for the player other than the skill from his position.
const char * getSkillsAsString ()
const char * getDisplay ()
void setDisplay (const char *display)
bool getMissNextMatch ()
void setMissNextMatch (bool b)
int getNigglingInjuries ()
void setNigglingInjuries (int ni)
int getMaReducted ()
void setMaReducted (int n)
int getAvReducted ()
void setAvReducted (int n)
int getAgReducted ()
void setAgReducted (int n)
int getStReducted ()
void setStReducted (int n)
const char * getInjuriesAsString ()
int getCompletions ()
void setCompletions (int com)
int getTouchDowns ()
void setTouchDowns (int td)
int getInterceptions ()
void setInterceptions (int in)
int getCasualties ()
void setCasualties (int ca)
int getMostValuablePlayer ()
void setMostValuablePlayer (int mvp)
int getStarPlayerPoints ()
long getValue ()

Static Public Member Functions

static const char * stringify (enum eStatus status)
static const char * stringify (enum eDeclaredAction action)
static const char * stringify (enum eRealAction action)
static const char * stringify (enum eSkill skill)

Public Attributes

string playername
string ip

Protected Attributes

int id_
 Player unique identifier.
int team_id_
 Team that this player belongs to (0 or 1).
Position pos_
 Position 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 eDeclaredAction action_
bool will_prone_

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]

Get player status.

See also:
Constant.hh

bool Player::hasSkill ( enum eSkill  skill  )  const [inline]

Check if this player has this skill.

Parameters:
skill Skill to check for.

bool Player::hasUsedSkill ( enum eSkill  skill  )  const [inline]

Check if this player has used this skill.

Parameters:
skill Skill to check for.


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