00001 // mortic - A game engine for the Expanses of Naryan. 00002 // Copyright (C) 2007 Aaron Griffith 00003 // This file is under the LGPL. See mortic.h for more information. 00004 00006 // _____ _ _ __ __ // 00007 // / ____| (_) | | | \/ | // 00008 // | (___ ___ _ __ _ _ __ | |_| \ / | __ _ _ __ __ _ __ _ ___ _ __ // 00009 // \___ \ / __| '__| | '_ \| __| |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__| // 00010 // ____) | (__| | | | |_) | |_| | | | (_| | | | | (_| | (_| | __/ | // 00011 // |_____/ \___|_| |_| .__/ \__|_| |_|\__,_|_| |_|\__,_|\__, |\___|_| // 00012 // | | __/ | // 00013 // |_| |___/ // 00014 // IScriptManager.h - Interface of ScriptManager // 00016 00017 #ifndef __IScriptManager_h_INCLUDED__ 00018 #define __IScriptManager_h_INCLUDED__ 00019 00020 #include <string> 00021 #include "IRoot.h" 00022 #include "IObject.h" 00023 00024 namespace mortic 00025 { 00027 00034 class IScript : public IObject 00035 { 00036 public: 00038 IScript(IRoot* root) : IObject(root, "Script") 00039 { } 00041 virtual ~IScript() 00042 { } 00043 00045 00050 virtual void runSimpleString(std::string str) = 0; 00051 00053 00058 virtual bool variableExists(std::string var) = 0; 00059 00061 00077 virtual float callFunction(std::string name, std::string format, ...) = 0; 00078 00080 00086 virtual std::string getNamespace() = 0; 00087 00089 00108 virtual void pushValue(float val) = 0; 00109 00111 00115 virtual float popValue() = 0; 00116 }; 00117 00119 00126 class IScriptManager : public IObject 00127 { 00128 public: 00130 IScriptManager(IRoot* root) : IObject(root, "ScriptManager") 00131 { } 00133 virtual ~IScriptManager() 00134 { } 00135 00137 00142 virtual IScript* createScript(std::string filename) = 0; 00143 00145 00150 virtual IScript* createScriptFromString(std::string script) = 0; 00151 }; 00152 00153 } 00154 ; // namespace mortic 00155 #endif // __IScriptManager_h_INCLUDED__