#pragma once #include "ScriptingEngine.h" #include "src/Core/FileSystem.h" #include #include struct WrenHandle; namespace Nuake { class WrenScript { private: bool CompiledSuccesfully; bool IsEntity = false; std::vector mModules; public: Ref mFile; std::map methods; WrenHandle* m_Instance; WrenHandle* m_OnInitHandle; WrenHandle* m_OnUpdateHandle; WrenHandle* m_OnFixedUpdateHandle; WrenHandle* m_OnExitHandle; WrenHandle* m_SetEntityIDHandle; // Building WrenScript(Ref file, bool isEntity); void ParseModules(); std::vector GetModules(); void Build(unsigned int moduleId, bool isEntity = false); // Method calls void CallInit(); void CallUpdate(float timestep); void CallFixedUpdate(float timestep); void CallExit(); void RegisterMethod(const std::string& signature); void CallMethod(const std::string& signature); void SetScriptableEntityID(int id); bool HasCompiledSuccesfully() { return CompiledSuccesfully; } }; }