00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _STATE_
00031 #define _STATE_
00032
00033 #include "Interface.h"
00034 class Model;
00035
00036 typedef enum {
00037 STATE_FIRST = 1000,
00038 STATE_INIT,
00039 STATE_USER_QUIT,
00040 STATE_QUIT,
00041 STATE_MAIN_MENU,
00042 STATE_GAME_INIT,
00043 STATE_GAME_MAIN,
00044 STATE_GAME_OVER,
00045 STATE_LAST
00046 } StateID;
00047
00048
00060 class State
00061 {
00062 protected:
00063 StateID ID;
00064 bool stopIntro;
00065 static State* currentState;
00066
00067 public:
00068 State() : ID(STATE_FIRST), stopIntro(false) { }
00069 State(StateID state);
00070 virtual ~State();
00071
00073 virtual void paint();
00075 virtual void doKey(int key, int x, int y, bool special,
00076 bool down, unsigned int modifiers);
00078 virtual void doMouseDown(Interface::MouseButtonType button,
00079 int x, int y) {}
00081 virtual void doMouseUp(Interface::MouseButtonType button, int x, int y) {}
00083 virtual void doMouseDragged(int x, int y) {}
00084
00089 static void SetState(StateID state);
00094 static void Destroy();
00096 static void DoRepaint();
00098 static void DoKey(int key, int x, int y,
00099 bool special, bool down, unsigned int modifiers);
00101 static void DoMouseDragged(int x, int y);
00103 static void DoMouse(int x, int y,
00104 Interface::MouseButtonType button, bool down);
00106 static void DoAnimateOneFrame(int value);
00107
00108
00110 static void SynchronizePreferences(int ignore);
00111 };
00112
00113 #endif //_STATE_