25#define SOL_NO_CHECK_NUMBER_PRECISION 1
26#define SOL_ALL_SAFETIES_ON 1
38#pragma region static_functions
53 static auto OpenScript(
const std::string& path) -> sol::load_result
77#pragma region overridden_functions
82 return std::make_unique<ScriptingManager>();
85 auto onUpdate(
float dt) ->
void override;
92 auto load(
const Stream& stream) ->
void override;
93 auto save(
Stream& stream)
const ->
void override;
97#pragma region ScriptManager_Functions
104 auto openScript(
const std::string& path) -> sol::load_result;
111 auto getFunction(
const std::string& name) -> sol::protected_function;
127#pragma region member_variables
134#pragma region helper_functions
141#pragma region static_variables
sys::Json Stream
Definition AudioObject.h:20
The class that holds the top node, and manages the main game loop, as well as startup and shutdown.
loads a lua file, and constructs an object based on it, then lets it run in the engine like a compone...
static auto getSystem() -> system *
A function to get a system.
Definition Engine.h:50
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
Type
Definition System.h:20
@ ScriptingManager
Definition System.h:35
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
ScriptingManager()
Definition ScriptingManager.cpp:33
auto operator=(ScriptingManager &&other) noexcept -> ScriptingManager &=delete
static auto OpenScript(const std::string &path) -> sol::load_result
opens a script and returns it's result. static way to call ScriptingManager::openScript()
Definition ScriptingManager.h:53
Script null_script
a script that doesn't exist, used for returning when finding scripts
Definition ScriptingManager.h:144
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition ScriptingManager.cpp:73
ScriptingManager(ScriptingManager &&other) noexcept=delete
static auto NULL_SCRIPT() -> Script &
gets the null script
Definition ScriptingManager.h:62
auto getState() -> sol::state &
get's a reference to the lua state (or stack) temporary while scripting is still not finalized
Definition ScriptingManager.h:118
sol::state lua
the lua stack. this IS lua, and everything that talks to lua at some point goes through this
Definition ScriptingManager.h:130
auto onUpdate(float dt) -> void override
called once every frame.
Definition ScriptingManager.cpp:64
auto getFunction(const std::string &name) -> sol::protected_function
get a function from the global table in lua
Definition ScriptingManager.cpp:120
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition ScriptingManager.h:87
static auto getEnum() -> Type
function required by all systems
Definition ScriptingManager.h:42
void bindPathType()
helper function to create lua bindings for paths, since it doesn't work well as a static member funct...
Definition ScriptingManager.cpp:83
~ScriptingManager() override=default
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition ScriptingManager.cpp:78
ScriptingManager(const ScriptingManager &other)=delete
auto openScript(const std::string &path) -> sol::load_result
opens a script and returns it's result.
Definition ScriptingManager.cpp:107
auto clone() const -> std::unique_ptr< GameObject > override
Clone is unimplemented b/c we aren't allowed to move lua state.
Definition ScriptingManager.h:80
auto onRender() -> void override
called every frame after update has been called for every object.
Definition ScriptingManager.cpp:69
auto operator=(const ScriptingManager &other) -> ScriptingManager &=delete
the type of elements in a basic_json container
Definition GameObject.h:37