Match implementation for the server.It symbolizes the state of a BB match, including teams, turns, timer, turnover and score. More...
#include <SMatch.hh>

Public Member Functions | |
| SMatch (SRules *r) | |
| virtual SBall * | getBall () |
| Return the ball of the game. | |
| virtual STeam * | getTeam (int team_id) |
| Return one of the competing teams. | |
| Dice * | getDice () |
| int | getCurrentTeamId () const |
| Return the current playing team id. | |
| STeam * | getCurrentTeam () |
| Return the current playing team. | |
| int | getCurrentOpponentTeamId () const |
| Return the current opposing playing team id. | |
| STeam * | getCurrentOpponentTeam () |
| Return the current opposing playing team. | |
| int | getOpponentTeamId (int team_id) const |
| int | getOpponentTeamId (STeam *team) const |
| STeam * | getOpponentTeam (int team_id) |
| STeam * | getOpponentTeam (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) |
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.
| STeam * SMatch::getCurrentOpponentTeam | ( | ) | [inline] |
Return the current opposing playing team.
References getCurrentOpponentTeamId(), and getTeam().
| int SMatch::getCurrentOpponentTeamId | ( | ) | const [inline] |
Return the current opposing playing team id.
References getCurrentTeamId().
Referenced by checkForCurrentOpponentChoice(), getCurrentOpponentTeam(), SPlayer::tryMove(), SPlayer::tryThrow(), and waitForCurrentOpponentChoice().
| STeam * SMatch::getCurrentTeam | ( | ) | [inline] |
Return the current playing team.
References getCurrentTeamId(), and getTeam().
Referenced by SPlayer::resolveBlockPush(), and SPlayer::tryBlockPush().
| int SMatch::getCurrentTeamId | ( | ) | const [inline] |
Return the current playing team id.
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.
| team_id | Team ID in the range [0, 1]. |
Reimplemented from Match< SPlayer >.
Referenced by SPlayer::considerBlockDices(), getCurrentOpponentTeam(), getCurrentTeam(), nextTurn(), and touchdooown().
1.6.3