00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef TEAM_HH_
00018 # define TEAM_HH_
00019
00020 # include "Constants.hh"
00021 # include "PacketHandler.hh"
00022
00029 DECLARE_PACKET(MSG_REROLL, MsgReroll)
00030 bool reroll;
00031 END_PACKET;
00032
00040 DECLARE_PACKET(MSG_TEAMINFO, MsgTeamInfo)
00041 int team_name[8];
00042 int coach_name[8];
00043 int reroll;
00044 END_PACKET;
00045
00052 DECLARE_PACKET(MSG_TOUCHDOOOWN, MsgTouchdooown)
00053 int player_id;
00054 END_PACKET;
00055
00060 template <typename T>
00061 class Team
00062 {
00063 public:
00064 Team(int team_id);
00065 virtual ~Team();
00066
00067 int getTeamId() const;
00068 int getNbPlayer() const;
00069 T* getPlayer(int id);
00070 const std::string& getTeamName() const;
00071 const std::string& getCoachName() const;
00072 int getScore() const;
00073 int getReroll() const;
00074 int getRemainingReroll() const;
00075
00080 bool canUseReroll() const;
00081 void useReroll();
00082 void initReroll();
00083
00084 bool hasDoneBlitz() const;
00085 bool hasDonePass() const;
00086
00087 void resetTurn();
00088 bool isPlacementValid() const;
00089
00090 void incrementScore();
00091
00092 protected:
00093 int team_id_;
00094 T* player_[MAX_PLAYER];
00095
00096 std::string team_name_;
00097 std::string coach_name_;
00098
00099 int score_;
00100 int reroll_;
00101 int reroll_remain_;
00102
00103 bool blitz_done_;
00104 bool pass_done_;
00105
00106 bool reroll_used_;
00107 };
00108
00109 # include "Team.hxx"
00110
00111 #endif