NLS Engine  v0.1
The Next Logical Step in game engine design.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
ScriptManager.h
Go to the documentation of this file.
00001 
00006 #pragma once
00007 
00008 #include <angelscript.h>
00009 #include <angelscript/scriptbuilder/scriptbuilder.h>
00010 
00011 class ScriptManager : public CScriptBuilder {
00012 public:
00013   static asIScriptEngine* GetEngine();
00014   
00015   ScriptManager(void);
00016   ~ScriptManager(void);
00017   int InitAngelScript(void);
00018   int CreateModule(std::string modname);
00019   int PrepareFunction(std::string funcname, std::string modname);
00020   int PrepareFunction(int funcID);
00021   int SetFunctionParamObject(int argIndex, void* param);
00022   int SetFunctionParamFloat(int argIndex, float param);
00023   int SetFunctionParamDouble(int argIndex, double param);
00024   int ExecuteFunction();
00025 
00026   void MessageCallback(const asSMessageInfo *msg);
00027   void ExceptionCallback(asIScriptContext* ctx);
00028 
00029   std::string* GetReturnString();
00030 private:
00031   static asIScriptEngine *engine;
00032   static int instanceCount;
00033   
00034   asIScriptContext *ctx; // We only need one context at this time
00035 };