SPlayer Class Reference
[Server Rules]

Player implementation for the server.

It symbolizes player and valids and applies action requests. More...

#include <SPlayer.hh>

Inheritance diagram for SPlayer:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SPlayer (SRules *r, const MsgPlayerCreate *m, STeam *t, SPlayerMsg *pm)
bool acceptPlayerCreation ()
 Checks some things, if this player could be valid.
bool checkAndDeclareTouchdooown ()
 Checks if the player scores a touchdooown, and eventually declares the touchdooown.
void setPosition (const Position &pos, bool advertise_client=true)
 Sets player position.
void setStatus (enum eStatus new_status)
 Sets player status and sends a MSG_STATUS to clients.
void setProne ()
 Sets status to prone if he has to.
void prepareKickoff ()
 Goes in the reserve if he can.
void setUsableSkill (enum eSkill skill)
 Sets the given skill as the only usable skill.
void checkArmour (int av_mod, int inj_mod)
 Checks for armour value and eventually injury.
void bePushedInTheCrowd ()
 Rolls for injury and sets player status.
void considerBlockDices (bool reroll)
 Rerolls the block dices if needed, otherwise gives the choice (if any) to a coach for which block dice to apply.
void resolveBlockDice (int chosen_dice)
 Applies block dice roll result.
void resolveBlockBothDownDefender (bool block)
 Applies BBOTH_DOWN block dice roll result.
void resolveBlockBothDownAttacker (bool block)
 Applies BBOTH_DOWN block dice roll result.
void resolveBlockDefenderStumble (bool dodge)
 Applies BDEFENDER_STUMBLE block dice roll result.
void setPusher (SPlayer *p)
 Sets pusher of this player.
void tryBlockPush (SPlayer *target)
 Tries to push the targetted player to a square.
void resolveBlockPush (int chosen_square)
 Selects chosen square to push the targetted player.
void considerBlockFollow ()
 Eventually gives the coach his choice to follow or not after a block push.
void finishBlockFollow (bool follow)
 Registers follow decision and moves to pushes application.
void finishBlockPush ()
 Applies pushes decisions, beginning by the last pushed player.
void finishBlockAction ()
 Applies follow decision, eventually knocks down the defender.
void tryCatchBall (bool accurate_pass)
 Tries to catch the ball.
void finishCatchBall (bool reroll, bool success)
void tryDodge ()
 Tries to dodge.
void finishDodge (bool reroll, bool success)
void tryMove (Position &aim)
 Tries to move to an adjacent square.
void tryPickUp ()
 Tries to pick up the ball.
void finishPickUp (bool reroll, bool success)
void tryStandUp ()
 Tries to stand up.
void finishStandUp (bool reroll, bool success)
void tryThrow ()
 Tries to throw the ball.
void finishThrow (bool reroll, int success)
void msgPlayerPos (const MsgPlayerPos *m)
void msgDeclare (const MsgDeclare *m)
void msgMove (const MsgMove *m)
void msgStandUp (const MsgStandUp *m)
void msgBlock (const MsgBlock *m)
void msgPass (const MsgPass *m)
void msgSkill (const MsgSkill *m)

Detailed Description

Player implementation for the server.

It symbolizes player and valids and applies action requests.

You will have up to 32 instances of this class at runtime, handled by the STeam and SPlayerMsg class.


Member Function Documentation

void SPlayer::setPosition ( const Position pos,
bool  advertise_client = true 
)

Sets player position.

Note:
Use this function instead of setting pos_ directly, so the field can be updated too.
Parameters:
pos Where to move.
advertise_client Whether or not send a MSG_PLAYERPOS to clients.

void SPlayer::setProne (  ) 

Sets status to prone if he has to.

Note:
Call this function at the end of his team turn.

void SPlayer::setStatus ( enum eStatus  new_status  ) 

Sets player status and sends a MSG_STATUS to clients.

Note:
Use this function instead of setting pos_ directly, so the field can be updated too.
Parameters:
new_status New status, it has to be different from the current one.

void SPlayer::tryBlockPush ( SPlayer target  ) 

Tries to push the targetted player to a square.

Eventually gives a coach his choice of which square to push the player to.


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