Contains details and functions for the game object.
More...
#include <GameObject.h>
Contains details and functions for the game object.
◆ GameObject()
GameObject::GameObject |
( |
std::string |
name | ) |
|
Constructs Application.
- Parameters
-
name | The name of the game object. |
◆ ~GameObject()
GameObject::~GameObject |
( |
| ) |
|
|
virtual |
◆ addComponent()
template<class T >
std::weak_ptr<T> GameObject::addComponent |
( |
| ) |
|
|
inline |
A template for adding components to the components vector.
◆ awake()
void GameObject::awake |
( |
| ) |
|
|
virtual |
A virtual function for the game objects awake.
◆ checkForComponent()
bool GameObject::checkForComponent |
( |
std::string |
id | ) |
|
A function to check the if the game object has a specific componet.
- Parameters
-
id | The type ID of the component to check for. |
- Returns
- If the game object contains the component.
◆ create()
std::weak_ptr< GameObject > GameObject::create |
( |
std::string |
name | ) |
|
|
static |
A static function to create a game object.
- Parameters
-
name | The name to give to the game object. |
- Returns
- A weak pointer to the created game object.
◆ destroy()
void GameObject::destroy |
( |
| ) |
|
|
virtual |
A virtual function for the game objects destroy.
◆ getComponent()
template<class T >
std::weak_ptr<T> GameObject::getComponent |
( |
| ) |
|
|
inline |
A template for getting a component from the components vector.
◆ getDestroyed()
bool GameObject::getDestroyed |
( |
| ) |
|
|
inline |
A function to get the componets destroyed boolean.
- Returns
- The boolean for the state of destroyed.
◆ getName()
std::string GameObject::getName |
( |
| ) |
|
|
inline |
A function to get the name of the game object.
- Parameters
-
The | name of the game object. |
◆ render()
void GameObject::render |
( |
| ) |
|
|
virtual |
A virtual function for the game objects render.
◆ setDestroyed()
void GameObject::setDestroyed |
( |
bool |
inDestroyed | ) |
|
|
inline |
A function to set the componets destroyed boolean.
- Parameters
-
inDestroyed | A boolean for the state of destroyed. |
◆ setName()
void GameObject::setName |
( |
std::string |
inName | ) |
|
|
inline |
A function to set the name of the game object.
- Parameters
-
inName | The name to give to the game object. |
◆ update()
void GameObject::update |
( |
| ) |
|
|
virtual |
A virtual function for the game objects update.
◆ componentIDs
std::vector< std::string > GameObject::componentIDs |
|
private |
A vector of the component ID's contained in the game object.
◆ components
std::vector< std::shared_ptr<Component> > GameObject::components |
|
private |
A vector of components attached to the game object.
◆ destroyed
bool GameObject::destroyed |
|
private |
A boolean for if the game object is destroyed.
◆ name
std::string GameObject::name |
|
private |
The name of the game object.
The documentation for this class was generated from the following files: