BaseCRules.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 BASECRULES_HH_
00018 # define BASECRULES_HH_
00019 
00020 # include "BaseRules.hh"
00021 
00022 class Event;
00023 class Api;
00024 
00025 class BaseCRules : public BaseRules
00026 {
00027 public:
00028   BaseCRules();
00029   virtual ~BaseCRules();
00030   
00033   int           getCoachId() const;
00034 
00037   int           getLeagueId() const;
00038 
00045   bool      isBusy() const;
00046 
00050   void          sendPacket(const Packet& p) const;
00051   
00054   void          setEventHandler(Event* evp);
00055 
00060   void      onEvent(int event);
00061 
00064   void          onEvent(const Packet* pkt);
00065 
00067   virtual Api*  getApi() = 0;
00068 
00069 private:
00070   void      msgCatchSync(const MsgSync* m);
00071   void          msgCatchUid(const ClientUid* m);
00072 
00073   int           coach_id_;
00074   int       league_id_;
00075   EventProcess  evp_;
00076   mutable int   busy_count_;
00077 };
00078 
00079 # include "BaseCRules.hxx"
00080 
00081 #endif /* !BASECRULES_HH_ */

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