STeam.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 ** 
00004 ** Copyright (C) 2006, 2007 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 SPlayer;
00024 class SPlayerMsg;
00025 class SRules;
00026 
00037 class STeam : public Team<SPlayer>
00038 {  
00039 public:
00040   STeam(int team_id, SRules* r, SPlayerMsg* pm);
00041 
00042   int state_; 
00043 
00044   bool canDeclareAction(const MsgDeclare* pkt);
00045 
00047   bool canDoAction(const Packet* pkt, SPlayer* p);
00048 
00049   void resetTurn();
00050   void setProneStunned();
00051   void prepareKickoff();
00052 
00054   SPlayer* getActivePlayer();
00056   void setPusher(SPlayer* p);
00057   void setNbChoices(int nb);
00058 
00059   // Message handlers called by STeamMsg.
00060   void msgTeamInfo(const MsgTeamInfo* m);
00061   void msgPlayerCreate(const MsgPlayerCreate* m);
00062   void msgReroll(const MsgReroll* m);
00063   void msgBlockDice(const MsgBlockDice* m);
00064   void msgFollow(const MsgFollow* m);
00065   void msgBlockPush(const MsgBlockPush* m);
00066 
00067 private:
00068   int active_player_id_; // Store ID is enough, since active player is from active team.
00069   SRules* r_;
00070   SPlayerMsg* pm_;
00071 
00072   int nb_choices_; // Number of block dices or squares to push to.
00073   SPlayer* current_pusher_; // When we are waiting for a blockPush choice.
00074 };
00075 
00076 #endif /* !STEAM_HH_ */

Generated on Sat Jun 23 16:07:24 2007 for Stechec/TBT by  doxygen 1.4.7