Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
00001 // Copyright 2006-2011 by Kat'Oun 00002 00003 #ifndef _SCRIPT_MANAGER_H_ 00004 #define _SCRIPT_MANAGER_H_ 00005 00006 #include <EngineConfig.h> 00007 #include <core/Types.h> 00008 #include <core/Singleton.h> 00009 #include <engine/EngineSettings.h> 00010 #include <resource/Resource.h> 00011 #include <resource/ResourceManager.h> 00012 #include <engine/Object.h> 00013 00014 #include <string> 00015 #include <map> 00016 00017 namespace script 00018 { 00019 00020 class ScriptDriver; 00021 class Script; 00022 00028 00029 class ENGINE_PUBLIC_EXPORT ScriptManager: public engine::Object, public core::Singleton<ScriptManager> 00030 { 00031 friend class ResourceManager; 00032 00033 public: 00034 00036 ScriptManager(); 00037 00038 ~ScriptManager(); 00039 00041 Script* createScript(const std::string& scriptFilename); 00042 00044 Script* getScript(const u32& id); 00045 00047 void removeScript(Script *scr); 00049 void removeScript(const u32& id); 00051 void removeAllScripts(); 00052 00054 void compile(Script* script); 00055 00057 void execute(const std::string& data, Script* script = NULL); 00058 00060 void runScript(Script* script); 00061 00062 void setScriptDriver(ScriptDriver* driver); 00063 void removeScriptDriver(); 00064 00065 static ScriptManager* getInstance(); 00066 00067 protected: 00068 00069 void initializeImpl(); 00070 void uninitializeImpl(); 00071 void updateImpl(f32 elapsedTime); 00072 00073 ScriptDriver* mScriptDriver; 00074 00076 std::map<u32, Script*> mScripts; 00077 }; 00078 00079 } // end namespace script 00080 00081 #endif
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:05 by
Doxygen
(1.7.4)
|