The Table Engine
|
Base class for scripting custom behaviors in game objects. More...
#include <script.h>
Public Member Functions | |
Script () | |
Default constructor, initializes an empty script. More... | |
Script (std::string name) | |
Constructs a Script with a specified name. More... | |
virtual | ~Script () |
Virtual destructor to allow for cleanup in derived script classes. More... | |
std::string | getName () |
Retrieves the name of the script. More... | |
GameObject * | getOwner () |
Retrieves the owner GameObject of this script. More... | |
void | setOwner (GameObject *owner) |
Sets the owner of this script. More... | |
virtual void | input () |
Virtual method for handling input. Should be overridden by derived classes. More... | |
virtual void | update () |
Virtual method for updating the script's state. Should be overridden by derived classes. More... | |
virtual void | render () |
Virtual method for rendering operations. Should be overridden by derived classes. More... | |
Public Attributes | |
std::string | m_name |
Name of the script, useful for identification or debugging. More... | |
GameObject * | m_owner |
Pointer to the GameObject that owns this script. More... | |
Base class for scripting custom behaviors in game objects.
Scripts are used to define interactive or autonomous behaviors for game objects. They can handle input, update logic, and rendering specifics for the associated game object.
Script::Script | ( | ) |
Default constructor, initializes an empty script.
Definition at line 5 of file script.cpp.
Script::Script | ( | std::string | name | ) |
Constructs a Script with a specified name.
name | Name of the script. |
Definition at line 6 of file script.cpp.
|
virtual |
Virtual destructor to allow for cleanup in derived script classes.
Definition at line 7 of file script.cpp.
std::string Script::getName | ( | ) |
Retrieves the name of the script.
Definition at line 9 of file script.cpp.
GameObject * Script::getOwner | ( | ) |
Retrieves the owner GameObject of this script.
Definition at line 13 of file script.cpp.
|
virtual |
Virtual method for handling input. Should be overridden by derived classes.
Reimplemented in RangedWeaponScript.
Definition at line 21 of file script.cpp.
|
virtual |
Virtual method for rendering operations. Should be overridden by derived classes.
Reimplemented in EnemyAIScript, and CollisionScript.
Definition at line 27 of file script.cpp.
void Script::setOwner | ( | GameObject * | owner | ) |
Sets the owner of this script.
owner | Pointer to the GameObject to be set as the owner of this script. |
Definition at line 17 of file script.cpp.
|
virtual |
Virtual method for updating the script's state. Should be overridden by derived classes.
Reimplemented in RangedWeaponScript, ProjectileScript, PlayerInputScript, EnemyAIScript, CrosshairScript, and CollisionScript.
Definition at line 24 of file script.cpp.
std::string Script::m_name |
GameObject* Script::m_owner |
Pointer to the GameObject that owns this script.