R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
LuaScript.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** RTYPE
4** File description:
5** LuaScript
6*/
7
8#pragma once
9
10#include <string>
11#include "IComponent.hpp"
12
13namespace ecs {
21 class LuaScript : public IComponent {
22 public:
28
33 explicit LuaScript(const std::string &scriptPath) : _scriptPath(scriptPath) {}
34 ~LuaScript() override = default;
35
40 const std::string &getScriptPath() const { return _scriptPath; }
41
46 void setScriptPath(const std::string &scriptPath) { _scriptPath = scriptPath; }
47
52 ComponentType getType() const override { return getComponentType<LuaScript>(); }
53
54 private:
55 std::string _scriptPath;
56 };
57} // namespace ecs
Base interface for all ECS components.
Component that holds the path to a Lua script for entity behavior.
Definition LuaScript.hpp:21
std::string _scriptPath
Definition LuaScript.hpp:55
ComponentType getType() const override
Get the unique type identifier for this component.
Definition LuaScript.hpp:52
~LuaScript() override=default
void setScriptPath(const std::string &scriptPath)
Set the path to the Lua script.
Definition LuaScript.hpp:46
const std::string & getScriptPath() const
Get the path to the Lua script.
Definition LuaScript.hpp:40
LuaScript()
Default constructor. Initializes with an empty script path.
Definition LuaScript.hpp:27
LuaScript(const std::string &scriptPath)
Constructor with script path.
Definition LuaScript.hpp:33
Maximum number of distinct component types supported by the Registry.
Definition GameLogic.hpp:26
std::size_t ComponentType
Type alias for component identification.