
Public Member Functions | |
| int | getCoachId () const |
| Get coach id. | |
| int | getLeagueId () const |
| Get team id. | |
| bool | isBusy () const |
| Check if rules is processing an order, ie when an order has been issued to the server, and waiting that the server send it last answer. | |
| void | sendPacket (const Packet &p) const |
| Send a packet to the other side. | |
| void | setEventHandler (Event *evp) |
| Register the class that will handle events. | |
| void | onEvent (int event) |
| Send an event to the UI. | |
| void | onEvent (const Packet *pkt) |
| Send an event to the UI. | |
| virtual Api * | getApi ()=0 |
| Get the real API for the contest (client-side only). | |
| int BaseCRules::getCoachId | ( | ) | const [inline] |
Get coach id.
Referenced by Api::doBlockPush(), Api::doChooseBlockDice(), Api::doFollow(), Api::doPlaceBall(), Api::doReroll(), Api::doUseSkill(), Api::getActivePlayer(), and Api::myTeamId().
| int BaseCRules::getLeagueId | ( | ) | const [inline] |
Get team id.
| bool BaseCRules::isBusy | ( | ) | const [inline] |
Check if rules is processing an order, ie when an order has been issued to the server, and waiting that the server send it last answer.
When sending a sequence of commands, it is generally advised to wait that a command is finished before sending another one. It is not mandatory.
| void BaseCRules::onEvent | ( | const Packet * | pkt | ) |
Send an event to the UI.
| pkt | Packet to send to the receiver. |
References PacketHistory::addCopy(), BASE_TOKEN_START, and Packet::token.
| void BaseCRules::onEvent | ( | int | event | ) |
Send an event to the UI.
Warning: Ugly kludge spotted. On contest Event dispatch(), you will receive a Packet with token == CUSTOM_EVENT, and client_id containing this parameter. Dispatch it as you like.
Referenced by CBall::setCoordinates(), and CBall::setOwner().
| void BaseCRules::sendPacket | ( | const Packet & | p | ) | const [inline] |
Send a packet to the other side.
| p | A packet to send. |
Reimplemented from BaseRules.
Referenced by CPlayer::beginAction(), CPlayer::block(), Api::doAskIllegalProcedure(), Api::doBlockPush(), Api::doCalmDown(), Api::doCelebrate(), Api::doCheatDice(), Api::doChooseBlockDice(), Api::doChooseKickoff(), Api::doEndPlacement(), Api::doEndTurn(), Api::doFollow(), Api::doGiveBall(), Api::doMoveTurnMarker(), Api::doPlaceBall(), Api::doPlacePlayer(), Api::doPlaceTeam(), Api::doReroll(), Api::doUseSkill(), CTeam::endAction(), CPlayer::foul(), CPlayer::handoff(), CTeam::loadConfig(), CTeam::loadPlayerConfig(), CPlayer::move(), CPlayer::pass(), CTeam::placeTeam(), SendingQueue::sendBlockDiceChoice(), Api::sendChatMessage(), Api::sendDebugRequest(), SendingQueue::sendNextMove(), and CPlayer::standUp().
| void BaseCRules::setEventHandler | ( | Event * | evp | ) | [inline] |
Register the class that will handle events.
| evp | Class that will receive event. Contest-specific. |
1.6.3