![]() |
Rune Engine
Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
|
Entity control system main object used for all objects in the scene. More...
#include <gameObject.h>
Public Member Functions | |
GameObject () | |
Default empty constructor. | |
void | addComponent (rune::Component &) |
Add a component to this game object. More... | |
int | getNumComponents (void) |
Get the number of components present on this game object. More... | |
void | instantiate (GameObject &) |
std::vector< Component * > & | getComponentList () |
Return a pointer to a component based off of index. Used for iterating through all components. More... | |
template<class classVariable > | |
classVariable * | getComponent () |
![]() | |
void | subscribe (Observer &newObserver) |
Tell the subject that an observer would like to be notified of signals. More... | |
bool | unsubscribe (Observer &newObserver) |
Tell the subject that an observer would no longer like to be notified of signals. More... | |
Public Attributes | |
rune::Transform | transform |
The location, scale, and rotation of the object in the world. | |
Additional Inherited Members | |
![]() | |
void | sendSignal (Signal) |
Send a signal to all observers. More... | |
int | getNumObservers (void) |
Get the number of observers subscribed to this subject. More... | |
![]() | |
std::vector< Observer * > | observers |
List of observers currently subscribed to this object. | |
Entity control system main object used for all objects in the scene.
void rune::GameObject::addComponent | ( | rune::Component & | newScript | ) |
Add a component to this game object.
newScript | The new component to be added to the game object. |
|
inline |
Locate components of the object based on data type Call the function like this: getComponent<rune::Sprite>();
std::vector< rune::Component * > & rune::GameObject::getComponentList | ( | ) |
Return a pointer to a component based off of index. Used for iterating through all components.
index | The position in the components vector to be accessed. |
int rune::GameObject::getNumComponents | ( | void | ) |
Get the number of components present on this game object.
void rune::GameObject::instantiate | ( | rune::GameObject & | newObject | ) |
newObject | The object that should be instantiated and copied. |