00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __GAME_H__
00012 #define __GAME_H__
00013
00014 #include "Common/CommonDll.h"
00015 #include <windows.h>
00016 #include "Common/Types.h"
00017
00018 class KIni;
00019 class KVariableList;
00020 class KCommandList;
00021
00022
00023 class COMMON_API KGame
00024 {
00025 protected:
00026 HINSTANCE m_hInstance;
00027 KIni* m_pIniFile;
00028 KVariableList* m_pVariable;
00029 KCommandList* m_pCommand;
00030 KTIME m_StartTime;
00031 KVERSION m_Version;
00032
00033 bool m_bQuit;
00034 HWND m_hWnd;
00035
00036 static void CommandEcho( KStr sArgument, void* pContext );
00037 static void CommandExit( KStr sArgument, void* pContext );
00038 static void CommandHelp( KStr sArgument, void* pContext );
00039
00040 public:
00041 KGame( HINSTANCE hInstance );
00042 virtual ~KGame();
00043
00044 virtual bool Init();
00045 virtual void Run()=0;
00046 virtual void End();
00047
00048
00049 void SethWnd( HWND hWnd ) { m_hWnd = hWnd; }
00050 HWND GethWnd() { return m_hWnd; }
00051 HINSTANCE GethInstance() { return m_hInstance; }
00052 KIni* GetpIniFile() { return m_pIniFile; }
00053 KVariableList* GetpVariable() { return m_pVariable; }
00054 KCommandList* GetpCommand() { return m_pCommand; }
00055 KTIME GetStartTime() { return m_StartTime; }
00056 KVERSION GetVersion() { return m_Version; }
00057
00058 void Quit() { m_bQuit = true; }
00059 };
00060
00061 extern COMMON_API KGame* g_pGame;
00062
00063 #endif __GAME_H__