SDL SPOOKY PLATFORMER ENGINE  0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
Public Member Functions | Protected Attributes | List of all members
GameObject Class Reference

#include <GameObject.hpp>

Public Member Functions

 GameObject (std::string tag)
 
 ~GameObject ()
 default deconstructor for deallocating components More...
 
std::string GetTag ()
 return this game objects tag More...
 
virtual void Update (float fixedTime)
 update this GameObject on a frame basis More...
 
virtual void Render (SDL_Renderer *ren)
 Render this object. More...
 
template<typename T , typename... TArgs>
void AddComponent (TArgs &&...mArgs)
 Add a component. More...
 
void RemoveComponent (Component *c)
 Remove a component. More...
 
template<typename C >
C * GetComponent () const
 Get a component. More...
 

Protected Attributes

std::vector< Component * > m_components
 
std::string m_tag
 

Constructor & Destructor Documentation

GameObject::GameObject ( std::string  tag)
GameObject::~GameObject ( )

default deconstructor for deallocating components

Member Function Documentation

template<typename T , typename... TArgs>
void GameObject::AddComponent ( TArgs &&...  mArgs)

Add a component.

template<typename C >
C* GameObject::GetComponent ( ) const

Get a component.

std::string GameObject::GetTag ( )

return this game objects tag

void GameObject::RemoveComponent ( Component c)

Remove a component.

void GameObject::Render ( SDL_Renderer *  ren)
virtual

Render this object.

void GameObject::Update ( float  deltaTime)
virtual

update this GameObject on a frame basis

Member Data Documentation

std::vector<Component*> GameObject::m_components
protected
std::string GameObject::m_tag
protected

The documentation for this class was generated from the following files: