/* Abstract instance of a game state. This contains the basic functions for game looping code, and has a fully-functional event handler we can overload later */ #ifndef _GAME_STATE_H_ #define _GAME_STATE_H_ #include "mainevent.h" #include #include #include using std::exception; using std::stack; class StateExit : public exception {}; class GameState : public MainEvent { public: GameState(SDL_Surface* display) { this->display = display; } ~GameState() {} virtual bool init() = 0; virtual void execute(stack &game_state) throw(StateExit) = 0; protected: SDL_Surface* display; }; #endif