61 void setFile(std::shared_ptr<File> file);
78 const std::shared_ptr<File>
getFile()
const;
143 static std::shared_ptr<ScriptComponent>
addScript(std::shared_ptr<GameObject>
object, std::shared_ptr<File> file);
150 static void addScript(std::shared_ptr<ScriptComponent> script);
157 static void removeScript(std::shared_ptr<ScriptComponent> script);
164 static std::vector<std::shared_ptr<ScriptComponent>>
getScripts();
182 static std::vector<std::shared_ptr<ScriptComponent>>
_scripts;
Contains the declaration of the Component class, a base class for game components.
A base class representing a component attached to a game object.
Definition: Component.hpp:20
Component(std::shared_ptr< GameObject > object)
Constructor to initialize a component with a shared pointer to a game object.
Definition: Component.cpp:5
A class representing a script component that can be attached to game objects.
Definition: ScriptComponent.hpp:52
static std::string SCRIPT_DESTINATION
The destination directory for scripts (static member).
Definition: ScriptComponent.hpp:174
static std::vector< std::shared_ptr< ScriptComponent > > getScripts()
Get a list of all managed script components.
Definition: ScriptComponent.cpp:63
static std::vector< std::shared_ptr< ScriptComponent > > _scripts
List of managed script components.
Definition: ScriptComponent.hpp:182
static void removeScript(std::shared_ptr< ScriptComponent > script)
Remove a script component from the list of managed scripts.
Definition: ScriptComponent.cpp:61
std::vector< PublicInt > _intVariables
List of public integer variables.
Definition: ScriptComponent.hpp:186
void setFile(std::shared_ptr< File > file)
Set the script file associated with this script component.
Definition: ScriptComponent.cpp:9
void update()
Update the script component.
Definition: ScriptComponent.cpp:14
std::shared_ptr< File > _file
The associated script file.
Definition: ScriptComponent.hpp:184
static void verifyScripts()
Verify the existence of script files and components.
Definition: ScriptComponent.cpp:81
std::vector< PublicVec3 > _vec3Variables
List of public glm::vec3 variables.
Definition: ScriptComponent.hpp:188
void addFloatVariable(std::string name)
Add a public float variable to the script component.
Definition: ScriptComponent.cpp:43
static std::shared_ptr< ScriptComponent > addScript(std::shared_ptr< GameObject > object, std::shared_ptr< File > file)
Add a script component to a game object and attach a script file.
Definition: ScriptComponent.cpp:53
std::vector< PublicInt > & getIntVariables()
Get a reference to the vector of public integer variables.
Definition: ScriptComponent.cpp:49
static void moveScripts()
Move all scripts to their respective destinations.
Definition: ScriptComponent.cpp:65
std::vector< PublicFloat > & getFloatVariables()
Get a reference to the vector of public float variables.
Definition: ScriptComponent.cpp:48
void moveScript()
Move the script associated with this component.
Definition: ScriptComponent.cpp:72
void addIntVariable(std::string name)
Add a public integer variable to the script component.
Definition: ScriptComponent.cpp:44
std::vector< PublicFloat > _floatVariables
List of public float variables.
Definition: ScriptComponent.hpp:185
const std::shared_ptr< File > getFile() const
Get the script file associated with this script component.
Definition: ScriptComponent.cpp:41
std::vector< PublicString > & getStringVariables()
Get a reference to the vector of public string variables.
Definition: ScriptComponent.cpp:50
void addStringVariable(std::string name)
Add a public string variable to the script component.
Definition: ScriptComponent.cpp:45
std::vector< PublicString > _stringVariables
List of public string variables.
Definition: ScriptComponent.hpp:187
void addVec3Variable(std::string name)
Add a public glm::vec3 variable to the script component.
Definition: ScriptComponent.cpp:46
std::vector< PublicVec3 > & getVec3Variables()
Get a reference to the vector of public glm::vec3 variables.
Definition: ScriptComponent.cpp:51
struct shkyera::PublicInt PublicInt
Structure to represent a public integer variable for use in scripts.
struct shkyera::PublicVec3 PublicVec3
Structure to represent a public glm::vec3 variable for use in scripts.
struct shkyera::PublicString PublicString
Structure to represent a public string variable for use in scripts.
struct shkyera::PublicFloat PublicFloat
Structure to represent a public float variable for use in scripts.
Structure to represent a public float variable for use in scripts.
Definition: ScriptComponent.hpp:17
std::string name
The name of the variable.
Definition: ScriptComponent.hpp:18
float value
The value of the variable.
Definition: ScriptComponent.hpp:19
Structure to represent a public integer variable for use in scripts.
Definition: ScriptComponent.hpp:25
std::string name
The name of the variable.
Definition: ScriptComponent.hpp:26
int value
The value of the variable.
Definition: ScriptComponent.hpp:27
Structure to represent a public string variable for use in scripts.
Definition: ScriptComponent.hpp:33
std::string value
The value of the variable.
Definition: ScriptComponent.hpp:35
std::string name
The name of the variable.
Definition: ScriptComponent.hpp:34
Structure to represent a public glm::vec3 variable for use in scripts.
Definition: ScriptComponent.hpp:41
std::string name
The name of the variable.
Definition: ScriptComponent.hpp:42
glm::vec3 value
The value of the variable.
Definition: ScriptComponent.hpp:43