f3c2e12c4e4a59d482b3291b30879730b9705c63.svn-base (995B)
1 #ifndef CONTEXT_H 2 #define CONTEXT_H 3 4 #include "Utils.h" 5 #include "Console.h" 6 #include "Event.h" 7 //#include "Level.h" 8 9 class Context 10 { 11 public: 12 13 Context() {} 14 15 virtual bool Load(const char* filename) = 0; 16 17 virtual bool Update() = 0; 18 19 SDL_Renderer* mRen; 20 EventFeed mFeed; 21 22 protected: 23 }; 24 25 class ContextManager : public EventReceiver 26 { 27 public: 28 29 ContextManager() {} 30 31 ContextManager(char* GameDataPath) : mGameDataPath(GameDataPath) {} 32 33 bool LogContext(Context* con, char* name); 34 35 bool LoadContext(char* ContextName); 36 37 bool ContextUpdate(); 38 39 bool EventProcess(Event eve); 40 41 protected: 42 43 char* mGameDataPath; 44 Context* mActiveContext; 45 std::vector<Context*> mContexts; 46 std::vector<char*> mNames; 47 48 }; 49 50 51 class GameOver : public Context, public EventReceiver 52 { 53 public: 54 55 GameOver() {}; 56 57 GameOver(SDL_Renderer* ren, SDL_Texture* splash) 58 { 59 mRen = ren; 60 mSplash = splash; 61 } 62 63 bool Update(); 64 65 bool EventProcess(Event eve); 66 67 EventFeed mFeed; 68 69 protected: 70 71 SDL_Texture* mSplash; 72 73 }; 74 #endif