SMatch Class Reference
[Server Rules]

Match implementation for the server.It symbolizes the state of a BB match, including teams, turns, timer, turnover and score. More...

#include <SMatch.hh>

Inheritance diagram for SMatch:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SMatch (SRules *r)
virtual SBallgetBall ()
 Return the ball of the game.
virtual STeamgetTeam (int team_id)
 Return one of the competing teams.
DicegetDice ()
int getCurrentTeamId () const
 Return the current playing team id.
STeamgetCurrentTeam ()
 Return the current playing team.
int getCurrentOpponentTeamId () const
 Return the current opposing playing team id.
STeamgetCurrentOpponentTeam ()
 Return the current opposing playing team.
int getOpponentTeamId (int team_id) const
int getOpponentTeamId (STeam *team) const
STeamgetOpponentTeam (int team_id)
STeamgetOpponentTeam (STeam *team)
void waitForCurrentOpponentChoice (int team_id)
 Pauses turn timer, if waiting for the current opponent coach..
void checkForCurrentOpponentChoice (int team_id)
 Restarts turn timer, if answering coach is the current opponent.
void finishKickoff ()
 The ball is in game, receiving team can play.
void nextTurn ()
 Go on next turn.
void turnover (enum eTurnOverMotive motive)
 Announce a turnover, stop the timer.
void touchdooown (SPlayer *p)
 Keeps the scoring player in mind and annonces a turnover.
void afterTouchdooown ()
 Launches kick-off, if needed, after a touchdooown.
virtual void serialize (std::ostream &os) const
virtual void unserialize (std::istream &is)

Friends

std::ostream & operator<< (std::ostream &os, const SMatch &m)

Detailed Description

Match implementation for the server.

It symbolizes the state of a BB match, including teams, turns, timer, turnover and score.

You will have only one instance of this class at runtime, handled by the SRules class.


Member Function Documentation

STeam * SMatch::getCurrentOpponentTeam (  )  [inline]

Return the current opposing playing team.

Returns:
NULL if no one play.

References getCurrentOpponentTeamId(), and getTeam().

int SMatch::getCurrentOpponentTeamId (  )  const [inline]

Return the current opposing playing team id.

Returns:
-1 if no one play, otherwise 0 or 1.

References getCurrentTeamId().

Referenced by checkForCurrentOpponentChoice(), getCurrentOpponentTeam(), SPlayer::tryMove(), SPlayer::tryThrow(), and waitForCurrentOpponentChoice().

STeam * SMatch::getCurrentTeam (  )  [inline]

Return the current playing team.

Returns:
NULL if no one play.

References getCurrentTeamId(), and getTeam().

Referenced by SPlayer::resolveBlockPush(), and SPlayer::tryBlockPush().

int SMatch::getCurrentTeamId (  )  const [inline]

Return the current playing team id.

Returns:
-1 if no one play, otherwise 0 or 1.

References Match< SPlayer >::active_team_id_, BaseRules::getState(), GS_INITKICKOFF, GS_KICKOFF, GS_TOUCHBACK, GS_TURN, and Match< SPlayer >::receiving_team_id_.

Referenced by getCurrentOpponentTeamId(), and getCurrentTeam().

STeam * SMatch::getTeam ( int  team_id  )  [inline, virtual]

Return one of the competing teams.

Parameters:
team_id Team ID in the range [0, 1].

Reimplemented from Match< SPlayer >.

Referenced by SPlayer::considerBlockDices(), getCurrentOpponentTeam(), getCurrentTeam(), nextTurn(), and touchdooown().


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