galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Script.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_LUA_SCRIPT_HPP_
9#define GALAXY_LUA_SCRIPT_HPP_
10
11#include <sol/sol.hpp>
12
13namespace galaxy
14{
18 class Script final
19 {
20 public:
24 Script() noexcept;
25
31 Script(const std::string& file);
32
36 ~Script() noexcept;
37
43 [[nodiscard]]
44 bool load(const std::string& file);
45
51 [[maybe_unused]]
52 sol::protected_function_result run();
53
54 private:
58 sol::load_result m_script;
59 };
60} // namespace galaxy
61
62#endif
An encapsulation of a bunch of functions for easy usage of a script.
Definition Script.hpp:19
~Script() noexcept
Destructor.
Definition Script.cpp:27
Script() noexcept
Constructor.
Definition Script.cpp:18
sol::protected_function_result run()
Run a lua script and get a return value.
Definition Script.cpp:53
bool load(const std::string &file)
Load a script.
Definition Script.cpp:31
sol::load_result m_script
Script loaded into sol3 memory.
Definition Script.hpp:58
Animated.cpp galaxy.
Definition Animated.cpp:16