src/Gamefsm.h

00001 #ifndef GAMEFSM_H
00002 #define GAMEFSM_H
00003 
00004 #include "SDL/SDL.h"
00005 
00006 class Logger; // Forward declarations.
00007 class Server;
00008 
00009 enum game_fsm_trans {t_main, t_quit, t_init};
00010 
00017 class Gamefsm
00018 {
00019 public:
00023     Gamefsm(Server* server);
00024 
00028     virtual ~Gamefsm();
00029 
00038     void threadBody();
00039 
00046     void Start();
00047 
00054     void Stop();
00055 
00062     void Evolve();
00063 
00071     SDL_Thread* getThread();
00072 
00073 protected:
00074 
00075 
00084         bool ExecTrans(game_fsm_trans t);
00085 
00086     void (Gamefsm::*ExecState)(void); 
00088 
00089     // MACHINE STATES START
00091 
00099     void Init();
00100 
00107     void Update();
00108 
00115     void Quit();
00116 
00118     // MACHINE STATES STOP
00120 
00121 private:
00122     Logger* myLogger;                   
00123     bool exitRequest;                   
00124     bool exitLoop;                      
00125     SDL_Thread* myThread;               
00126     Server* myServer;                   
00139     static int startThread (void * data);
00140 
00141 };
00142 
00143 
00144 
00145 #endif // GAMEFSM_H

Generated on Mon Dec 3 04:30:13 2007 for lo-testserver by  doxygen 1.3.9.1