Leviathan  0.8.0.0
Leviathan game engine
Leviathan::ScriptScript Class Reference

#include <ScriptScript.h>

Public Member Functions

DLLEXPORT ScriptScript (std::weak_ptr< ScriptModule > wptr)
 
DLLEXPORT ScriptScript (const int &MID, std::weak_ptr< ScriptModule > wptr)
 
DLLEXPORT ScriptScript (const ScriptScript &other)
 
DLLEXPORT ~ScriptScript ()
 
DLLEXPORT ScriptModuleGetModule ()
 Returns an unsafe pointer to the module. More...
 
DLLEXPORT std::shared_ptr< ScriptModuleGetModuleSafe ()
 Locks the weak pointer and returns the std::shared_ptr. More...
 

Detailed Description

holds a reference of script module

Todo:
Remove this and replace with direct access to ScriptModule

Definition at line 11 of file ScriptScript.h.

Constructor & Destructor Documentation

◆ ScriptScript() [1/3]

DLLEXPORT Leviathan::ScriptScript::ScriptScript ( std::weak_ptr< ScriptModule wptr)

Definition at line 20 of file ScriptScript.cpp.

20  :
21  ScriptsModule(wptr), ModuleID(wptr.lock()->GetID())
22 {
23 
24 }
DLLEXPORT int GetID()
Definition: ScriptModule.h:111

◆ ScriptScript() [2/3]

DLLEXPORT Leviathan::ScriptScript::ScriptScript ( const int &  MID,
std::weak_ptr< ScriptModule wptr 
)

Definition at line 8 of file ScriptScript.cpp.

8  :
9  ScriptsModule(wptr), ModuleID(MID)
10 {
11 
12 }

◆ ScriptScript() [3/3]

DLLEXPORT Leviathan::ScriptScript::ScriptScript ( const ScriptScript other)

Definition at line 14 of file ScriptScript.cpp.

14  {
15  // copy over //
16  ModuleID = other.ModuleID;
17  ScriptsModule = other.ScriptsModule;
18 }

◆ ~ScriptScript()

DLLEXPORT Leviathan::ScriptScript::~ScriptScript ( )

Definition at line 26 of file ScriptScript.cpp.

26  {
27 
28 }

Member Function Documentation

◆ GetModule()

DLLEXPORT ScriptModule* Leviathan::ScriptScript::GetModule ( )
inline

Returns an unsafe pointer to the module.

Deprecated:
GetModuleSafe should be used instead, will probably be around for a while

Definition at line 20 of file ScriptScript.h.

20  {
21  return ScriptsModule.lock().get();
22  }

◆ GetModuleSafe()

DLLEXPORT std::shared_ptr<ScriptModule> Leviathan::ScriptScript::GetModuleSafe ( )
inline

Locks the weak pointer and returns the std::shared_ptr.

Note
This should be used instead of GetModule if some methods are called on the pointer

Definition at line 27 of file ScriptScript.h.

27  {
28 
29  return ScriptsModule.lock();
30  }

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