CMatch.hh

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 CMATCH_HH_
00018 # define CMATCH_HH_
00019 
00020 # include "CBall.hh"
00021 # include "CField.hh"
00022 # include "Constants.hh"
00023 # include "CPlayer.hh"
00024 # include "CTeam.hh"
00025 # include "Match.hh"
00026 
00027 class CRules;
00028 
00033 class CMatch : public Match<CPlayer>
00034 {
00035   friend class Api;
00036   
00037 public:
00038   CMatch(CRules* r, const MsgInitGame* m);
00039   virtual ~CMatch();
00040 
00041   virtual CField* getField();
00042   virtual CTeam* getTeam(int team_id);
00043 
00044   // FIXME: see later.
00045   virtual void serialize(std::ostream& os) const;
00046   virtual void unserialize(std::istream& is);
00047 
00048   friend std::ostream& operator<< (std::ostream& os, const CMatch& m);
00049 
00050 private:
00051   // Methods to catch server response.
00052   void msgInitHalf(const MsgInitHalf* m);
00053   void msgPlayTurn(const MsgNewTurn* m);
00054   void msgEndTurn(const MsgEndTurn* m);
00055   void msgTimer(const MsgTimer* m);
00056   void msgTurnOver(const MsgTurnOver* m);
00057   void msgMoveTurnMarker(const MsgMoveTurnMarker* m);
00058   void msgResult(const MsgResult* m);
00059   void msgBlockResult(const MsgBlockResult* m);
00060   void msgBlockDice(const MsgBlockDice* m);
00061   void msgFollow(const MsgFollow* m);
00062   void msgBlockPush(const MsgBlockPush* m);
00063 
00064   CRules* r_; 
00065 };
00066 
00067 # include "CMatch.hxx"
00068 
00069 #endif /* !CMATCH_HH_ */
Generated on Mon Apr 5 21:17:11 2010 for Stechec/TBT by  doxygen 1.6.3