Can now have multiple instances of the same script without compile errors
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "src/Core/Core.h"
|
||||
@@ -12,12 +13,15 @@ class ScriptingEngine
|
||||
{
|
||||
private:
|
||||
static WrenVM* m_WrenVM;
|
||||
|
||||
static std::vector<std::string> m_LoadedScripts;
|
||||
static std::map<std::string, Ref<WrenScript>> m_Scripts;
|
||||
static std::map<std::string, Ref<ScriptModule>> Modules;
|
||||
public:
|
||||
static Ref<WrenScript> RegisterScript(const std::string& path, const std::string& mod);
|
||||
static bool IsScriptImported(const std::string& path);
|
||||
static void ImportScript(const std::string& path);
|
||||
static void RegisterModule(Ref<ScriptModule> module);
|
||||
static void RegisterMethod(void* method, const std::string& module, const std::string& signature);
|
||||
static void InitScript(Ref<WrenScript> script);
|
||||
static void UpdateScript(Ref<WrenScript> script, Timestep timestep);
|
||||
static void ExitScript(Ref<WrenScript> script);
|
||||
@@ -25,6 +29,8 @@ public:
|
||||
static void RunCode(const std::string& code);
|
||||
static void Close();
|
||||
|
||||
|
||||
|
||||
static WrenForeignMethodFn bindForeignMethod(
|
||||
WrenVM* vm,
|
||||
const char* module,
|
||||
|
||||
Reference in New Issue
Block a user