R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
ecs::LuaScript Class Reference

Component that holds the path to a Lua script for entity behavior. More...

#include <LuaScript.hpp>

Inheritance diagram for ecs::LuaScript:
Inheritance graph
Collaboration diagram for ecs::LuaScript:
Collaboration graph

Public Member Functions

 LuaScript ()
 Default constructor. Initializes with an empty script path.
 
 LuaScript (const std::string &scriptPath)
 Constructor with script path.
 
 ~LuaScript () override=default
 
const std::string & getScriptPath () const
 Get the path to the Lua script.
 
void setScriptPath (const std::string &scriptPath)
 Set the path to the Lua script.
 
ComponentType getType () const override
 Get the unique type identifier for this component.
 
- Public Member Functions inherited from ecs::IComponent
virtual ~IComponent ()=default
 Virtual destructor.
 

Private Attributes

std::string _scriptPath
 

Detailed Description

Component that holds the path to a Lua script for entity behavior.

This component allows entities to be associated with Lua scripts, enabling dynamic behavior defined in external script files.

Definition at line 21 of file LuaScript.hpp.

Constructor & Destructor Documentation

◆ LuaScript() [1/2]

ecs::LuaScript::LuaScript ( )
inline

Default constructor. Initializes with an empty script path.

Definition at line 27 of file LuaScript.hpp.

◆ LuaScript() [2/2]

ecs::LuaScript::LuaScript ( const std::string &  scriptPath)
inlineexplicit

Constructor with script path.

Parameters
scriptPathPath to the Lua script file.

Definition at line 33 of file LuaScript.hpp.

◆ ~LuaScript()

ecs::LuaScript::~LuaScript ( )
overridedefault

Member Function Documentation

◆ getScriptPath()

const std::string & ecs::LuaScript::getScriptPath ( ) const
inline

Get the path to the Lua script.

Returns
const std::string& The script file path.

Definition at line 40 of file LuaScript.hpp.

References _scriptPath.

Referenced by scripting::LuaSystemAdapter::update().

◆ getType()

ComponentType ecs::LuaScript::getType ( ) const
inlineoverridevirtual

Get the unique type identifier for this component.

Returns
ComponentType The unique ID of this component type.

Implements ecs::IComponent.

Definition at line 52 of file LuaScript.hpp.

◆ setScriptPath()

void ecs::LuaScript::setScriptPath ( const std::string &  scriptPath)
inline

Set the path to the Lua script.

Parameters
scriptPathNew script file path.

Definition at line 46 of file LuaScript.hpp.

References _scriptPath.

Member Data Documentation

◆ _scriptPath

std::string ecs::LuaScript::_scriptPath
private

Path to the Lua script file

Definition at line 55 of file LuaScript.hpp.

Referenced by getScriptPath(), and setScriptPath().


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