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::Script Class Referencefinal

An encapsulation of a bunch of functions for easy usage of a script. More...

#include <Script.hpp>

+ Collaboration diagram for galaxy::Script:

Public Member Functions

 Script () noexcept
 Constructor.
 
 Script (const std::string &file)
 Argument Constructor.
 
 ~Script () noexcept
 Destructor.
 
bool load (const std::string &file)
 Load a script.
 
sol::protected_function_result run ()
 Run a lua script and get a return value.
 

Private Attributes

sol::load_result m_script
 Script loaded into sol3 memory.
 

Detailed Description

An encapsulation of a bunch of functions for easy usage of a script.

Definition at line 18 of file Script.hpp.

Constructor & Destructor Documentation

◆ Script() [1/2]

galaxy::Script::Script ( )
noexcept

Constructor.

Definition at line 18 of file Script.cpp.

◆ Script() [2/2]

galaxy::Script::Script ( const std::string & file)

Argument Constructor.

Parameters
fileFile in VFS to load as a script.

Definition at line 22 of file Script.cpp.

+ Here is the call graph for this function:

◆ ~Script()

galaxy::Script::~Script ( )
noexcept

Destructor.

Definition at line 27 of file Script.cpp.

Member Function Documentation

◆ load()

bool galaxy::Script::load ( const std::string & file)
nodiscard

Load a script.

Parameters
fileFile in VFS to load as a script.

Definition at line 31 of file Script.cpp.

+ Here is the caller graph for this function:

◆ run()

sol::protected_function_result galaxy::Script::run ( )

Run a lua script and get a return value.

Returns
Value returned from script execution. You will need to extract from function result and check validity.

Definition at line 53 of file Script.cpp.

Member Data Documentation

◆ m_script

sol::load_result galaxy::Script::m_script
private

Script loaded into sol3 memory.

Definition at line 58 of file Script.hpp.


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