![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
High level abstraction of a lua script. More...
#include <Script.hpp>
Public Member Functions | |
Script () | |
Constructor. | |
Script (const nlohmann::json &json) | |
JSON constructor. | |
Script (Script &&) | |
Move constructor. | |
Script & | operator= (Script &&) |
Move assignment operator. | |
virtual | ~Script () |
Destructor. | |
const std::string & | file () const |
Get script file path. | |
nlohmann::json | serialize () override |
Serializes object. | |
void | deserialize (const nlohmann::json &json) override |
Deserializes from object. | |
![]() | |
virtual | ~Serializable () |
Destructor. | |
virtual Serializable & | operator= (Serializable &&)=default |
Move assignment operator. | |
virtual Serializable & | operator= (const Serializable &)=default |
Copy assignment operator. | |
Public Attributes | |
sol::table | m_self |
The script object (table) returned by a lua script. | |
sol::function | m_update |
The update function belonging to the lua table. | |
Private Member Functions | |
void | load (std::string_view file) |
Load a script. | |
Script & | operator= (const Script &)=delete |
Copy assignment operator. | |
Script (const Script &)=delete | |
Copy constructor. | |
Private Attributes | |
std::string | m_file |
Script file. | |
bool | m_show_functions = false |
For editor. Show functions. | |
bool | m_show_userdata = false |
For editor. Shows userdata types. | |
bool | m_show_unknown = false |
For editor. Show unknown type data. | |
Additional Inherited Members | |
![]() | |
Serializable () | |
Constructor. | |
High level abstraction of a lua script.
Definition at line 30 of file Script.hpp.
galaxy::components::Script::Script | ( | ) |
Constructor.
Definition at line 19 of file Script.cpp.
galaxy::components::Script::Script | ( | const nlohmann::json & | json | ) |
JSON constructor.
json | JSON defining object. |
Definition at line 24 of file Script.cpp.
galaxy::components::Script::Script | ( | Script && | s | ) |
Move constructor.
Definition at line 30 of file Script.cpp.
|
virtual |
Destructor.
Definition at line 55 of file Script.cpp.
|
privatedelete |
Copy constructor.
Move assignment operator.
Definition at line 40 of file Script.cpp.
|
nodiscard |
Get script file path.
Definition at line 81 of file Script.cpp.
|
nodiscardoverridevirtual |
Serializes object.
Implements galaxy::fs::Serializable.
Definition at line 86 of file Script.cpp.
|
overridevirtual |
Deserializes from object.
json | Json object to retrieve data from. |
Implements galaxy::fs::Serializable.
Definition at line 97 of file Script.cpp.
|
private |
Load a script.
file | File in VFS to load as a script. |
Definition at line 59 of file Script.cpp.
Copy assignment operator.
sol::table galaxy::components::Script::m_self |
The script object (table) returned by a lua script.
Definition at line 107 of file Script.hpp.
sol::function galaxy::components::Script::m_update |
The update function belonging to the lua table.
Definition at line 112 of file Script.hpp.
|
private |
Script file.
Definition at line 118 of file Script.hpp.
|
private |
For editor. Show functions.
Definition at line 123 of file Script.hpp.
|
private |
For editor. Shows userdata types.
Definition at line 128 of file Script.hpp.
|
private |
For editor. Show unknown type data.
Definition at line 133 of file Script.hpp.