8#ifndef GALAXY_COMPONENTS_SCRIPT_HPP_
9#define GALAXY_COMPONENTS_SCRIPT_HPP_
32 friend class sc::panel::EntityEditor;
45 Script(
const nlohmann::json& json);
68 const std::string&
file()
const;
83 void deserialize(
const nlohmann::json& json)
override;
High level abstraction of a lua script.
virtual ~Script()
Destructor.
bool m_show_userdata
For editor. Shows userdata types.
bool m_show_unknown
For editor. Show unknown type data.
const std::string & file() const
Get script file path.
Script & operator=(Script &&)
Move assignment operator.
void deserialize(const nlohmann::json &json) override
Deserializes from object.
void load(std::string_view file)
Load a script.
bool m_show_functions
For editor. Show functions.
nlohmann::json serialize() override
Serializes object.
Script(const Script &)=delete
Copy constructor.
sol::table m_self
The script object (table) returned by a lua script.
Script & operator=(const Script &)=delete
Copy assignment operator.
std::string m_file
Script file.
sol::function m_update
The update function belonging to the lua table.
Allows a class to be serialized.