The Table Engine
script.cpp
Go to the documentation of this file.
1 #include <string>
2 
3 #include "script.h"
4 
5 Script::Script() : m_name(""), m_owner(NULL) {}
6 Script::Script(std::string name) : m_name(name), m_owner(NULL) {}
8 
9 std::string Script::getName() {
10  return m_name;
11 }
12 
14  return m_owner;
15 }
16 
18  m_owner = owner;
19 }
20 
21 void Script::input() {
22 }
23 
25 }
26 
28 }
Core class representing an entity in the game world.
Definition: gameobject.h:20
Script()
Default constructor, initializes an empty script.
Definition: script.cpp:5
void setOwner(GameObject *owner)
Sets the owner of this script.
Definition: script.cpp:17
virtual void input()
Virtual method for handling input. Should be overridden by derived classes.
Definition: script.cpp:21
std::string getName()
Retrieves the name of the script.
Definition: script.cpp:9
virtual ~Script()
Virtual destructor to allow for cleanup in derived script classes.
Definition: script.cpp:7
std::string m_name
Name of the script, useful for identification or debugging.
Definition: script.h:24
virtual void render()
Virtual method for rendering operations. Should be overridden by derived classes.
Definition: script.cpp:27
GameObject * getOwner()
Retrieves the owner GameObject of this script.
Definition: script.cpp:13
GameObject * m_owner
Pointer to the GameObject that owns this script.
Definition: script.h:25
virtual void update()
Virtual method for updating the script's state. Should be overridden by derived classes.
Definition: script.cpp:24
Defines the Script class for attaching behavior to game objects.