|
Jagguar Game Engine
|
#include <GameObject.hpp>
Public Member Functions | |
| GameObject (std::string name) | |
| ~GameObject () | |
| void | Update (SDL_Event e, int frame, std::vector< std::string > broadcastList) |
| void | Render (SDL_Renderer *ren) |
| void | AddComponent (Component *c) |
| void | RemoveComponent (Component *c) |
| const std::vector< Component * > | ListComponents () |
| std::string | GetName () |
Private Attributes | |
| std::vector< Component * > | m_components |
| std::string | m_name |
A representation of any object in the game. Has minimal functionality on its own, holds a list of Component objects which handle all game-related tasks.
| GameObject::GameObject | ( | std::string | name | ) |
Construct a new Game Object
| name | the name of the GameObject |
| GameObject::~GameObject | ( | ) |
Destroy the Game Object
| void GameObject::AddComponent | ( | Component * | c | ) |
Add a new Component to the GameObject.
| c | a pointer to the Component to be added |

| std::string GameObject::GetName | ( | ) |
Gets the name of the GameObject.

| const std::vector< Component * > GameObject::ListComponents | ( | ) |
Gets a list of all components within the GameObject.

| void GameObject::RemoveComponent | ( | Component * | c | ) |
Remove a Component from the GameObject.
| c | a pointer to the Component to be removed |

| void GameObject::Render | ( | SDL_Renderer * | ren | ) |
Render all components within the GameObject.
| ren | the renderer to be drawn to |
| void GameObject::Update | ( | SDL_Event | e, |
| int | frame, | ||
| std::vector< std::string > | broadcastList | ||
| ) |
Update all components within the GameObject.
| e | any user input |
| frame | the current frame |
| broadcastList | a list of messages for components to talk to each other |