00001 /* 00002 ** TowBowlTactics, a turn-based strategy football game. 00003 ** 00004 ** Copyright (C) 2006-2010 The TBT Team. 00005 ** 00006 ** This program is free software; you can redistribute it and/or 00007 ** modify it under the terms of the GNU General Public License 00008 ** as published by the Free Software Foundation; either version 2 00009 ** of the License, or (at your option) any later version. 00010 ** 00011 ** The complete GNU General Public Licence Notice can be found as the 00012 ** `NOTICE' file in the root directory. 00013 ** 00014 ** The TBT Team consists of people listed in the `AUTHORS' file. 00015 */ 00016 00017 #ifndef STEAM_HH_ 00018 # define STEAM_HH_ 00019 00020 # include "Player.hh" 00021 # include "Team.hh" 00022 00023 class SMatch; 00024 class SPlayer; 00025 class SPlayerMsg; 00026 class SRules; 00027 00038 class STeam : public Team<SPlayer> 00039 { 00040 public: 00041 STeam(int team_id, SRules* r, SMatch* m, SPlayerMsg* pm); 00042 00043 int state_; 00044 00046 bool isValid() const; 00047 00048 bool canBeginAction(const MsgAction* pkt); 00049 bool canEndAction(const MsgAction* pkt); 00050 00052 bool canDoEffort(const Packet* pkt, SPlayer* p); 00053 00054 void resetTurn(); 00055 void setProneStunned(); 00056 void prepareKickoff(); 00057 00059 SPlayer* getActivePlayer() const; 00061 void unsetActivePlayer(); 00062 00064 void setPusher(SPlayer* p); 00065 void setNbChoices(int nb); 00066 00067 // Message handlers called by STeamMsg. 00068 void msgTeamInfo(const MsgTeamInfo* m); 00069 void msgPlayerCreate(const MsgPlayerCreate* m); 00070 void msgReroll(const MsgReroll* m); 00071 void msgBlockDice(const MsgBlockDice* m); 00072 void msgFollow(const MsgFollow* m); 00073 void msgBlockPush(const MsgBlockPush* m); 00074 00075 private: 00076 SRules* r_; 00077 SMatch* m_; 00078 SPlayerMsg* pm_; 00079 00080 int nb_choices_; // Number of block dices or squares to push to. 00081 SPlayer* current_pusher_; // When we are waiting for a blockPush choice. 00082 }; 00083 00084 #endif /* !STEAM_HH_ */
1.6.3