SRules.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SRULES_HH_
00018 # define SRULES_HH_
00019
00020 # include "rules/BaseSRules.hh"
00021 # include "Constants.hh"
00022
00023 class App;
00024 class OpStack;
00025 class SMatch;
00026 class SPlayerMsg;
00027 class STeamMsg;
00028
00033 class CoachErrorCustom {};
00034
00044 class SRules : public BaseSRules
00045 {
00046 public:
00047 SRules(App* app);
00048 virtual ~SRules();
00049
00051 void sendIllegal(int token, int from, enum eError error);
00052
00053 OpStack* getOpStack();
00054 App* getApp();
00055 SMatch* getMatch();
00056 SPlayerMsg* getPlayerMsg();
00057 STeamMsg* getTeamMsg();
00058
00060 virtual void setState(int new_state);
00061
00064 virtual void serverStartup();
00065
00068 virtual void serverProcess();
00069
00071 virtual bool coachKilled(int coach_id, CoachErrorCustom*& cec);
00072
00073 virtual void serialize(std::ostream& os) const;
00074 virtual void unserialize(std::istream& is);
00075
00076 friend std::ostream& operator<< (std::ostream& os, const SRules& r);
00077
00078 private:
00080 const char* tokenToString(unsigned token) const;
00081
00082 void msgForwardChat(const MsgChat* m);
00083 void msgForwardDebug(const MsgDebug* m);
00084
00085 App* app_;
00086 SMatch* match_;
00087 STeamMsg* team_msg_;
00088 SPlayerMsg* player_msg_;
00089 OpStack* op_stack_;
00090 };
00091
00092 # include "SRules.hxx"
00093
00094 #endif