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
galaxy::components::GUI Class Referencefinal

Script for running an active UI. More...

#include <GUI.hpp>

+ Inheritance diagram for galaxy::components::GUI:
+ Collaboration diagram for galaxy::components::GUI:

Public Member Functions

 GUI ()
 Constructor.
 
 GUI (const nlohmann::json &json)
 JSON constructor.
 
 GUI (GUI &&)
 Move constructor.
 
GUIoperator= (GUI &&)
 Move assignment operator.
 
virtual ~GUI ()
 Destructor.
 
void load (const std::string &file)
 Load script and set context.
 
const std::string & file () const
 Get script file.
 
nlohmann::json serialize () override
 Serializes object.
 
void deserialize (const nlohmann::json &json) override
 Deserializes from object.
 
- Public Member Functions inherited from galaxy::fs::Serializable
virtual ~Serializable ()
 Destructor.
 
virtual Serializableoperator= (Serializable &&)=default
 Move assignment operator.
 
virtual Serializableoperator= (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

GUIoperator= (const GUI &)=delete
 Copy assignment operator.
 
 GUI (const GUI &)=delete
 Copy constructor.
 

Private Attributes

std::string m_file
 Script file.
 

Additional Inherited Members

- Protected Member Functions inherited from galaxy::fs::Serializable
 Serializable ()
 Constructor.
 

Detailed Description

Script for running an active UI.

Definition at line 22 of file GUI.hpp.

Constructor & Destructor Documentation

◆ GUI() [1/4]

galaxy::components::GUI::GUI ( )

Constructor.

Definition at line 20 of file GUI.cpp.

◆ GUI() [2/4]

galaxy::components::GUI::GUI ( const nlohmann::json & json)

JSON constructor.

Parameters
jsonJSON defining object.

Definition at line 24 of file GUI.cpp.

+ Here is the call graph for this function:

◆ GUI() [3/4]

galaxy::components::GUI::GUI ( GUI && s)

Move constructor.

Definition at line 29 of file GUI.cpp.

◆ ~GUI()

galaxy::components::GUI::~GUI ( )
virtual

Destructor.

Definition at line 48 of file GUI.cpp.

◆ GUI() [4/4]

galaxy::components::GUI::GUI ( const GUI & )
privatedelete

Copy constructor.

Member Function Documentation

◆ operator=() [1/2]

GUI & galaxy::components::GUI::operator= ( GUI && s)

Move assignment operator.

Definition at line 36 of file GUI.cpp.

◆ load()

void galaxy::components::GUI::load ( const std::string & file)

Load script and set context.

Parameters
fileScript file to load.

Definition at line 56 of file GUI.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ file()

const std::string & galaxy::components::GUI::file ( ) const
nodiscard

Get script file.

Returns
Const string reference.

Definition at line 112 of file GUI.cpp.

+ Here is the caller graph for this function:

◆ serialize()

nlohmann::json galaxy::components::GUI::serialize ( )
nodiscardoverridevirtual

Serializes object.

Returns
JSON object containing data to be serialized.

Implements galaxy::fs::Serializable.

Definition at line 117 of file GUI.cpp.

◆ deserialize()

void galaxy::components::GUI::deserialize ( const nlohmann::json & json)
overridevirtual

Deserializes from object.

Parameters
jsonJson object to retrieve data from.

Implements galaxy::fs::Serializable.

Definition at line 125 of file GUI.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [2/2]

GUI & galaxy::components::GUI::operator= ( const GUI & )
privatedelete

Copy assignment operator.

Member Data Documentation

◆ m_self

sol::table galaxy::components::GUI::m_self

The script object (table) returned by a lua script.

Definition at line 95 of file GUI.hpp.

◆ m_update

sol::function galaxy::components::GUI::m_update

The update function belonging to the lua table.

Definition at line 100 of file GUI.hpp.

◆ m_file

std::string galaxy::components::GUI::m_file
private

Script file.

Definition at line 106 of file GUI.hpp.


The documentation for this class was generated from the following files: