Building Game Engines
Public Member Functions | Public Attributes | List of all members
GameObject Class Reference

#include <GameObject.hpp>

Collaboration diagram for GameObject:
Collaboration graph

Public Member Functions

 GameObject ()
 
 ~GameObject ()
 
void Input (SDL_Event e)
 
void Update ()
 
void Render (SDL_Renderer *renderer)
 
void AddComponent (Component *c)
 
void RemoveComponent ()
 

Public Attributes

std::vector< Component * > m_components
 

Detailed Description

A game object

Constructor & Destructor Documentation

◆ GameObject()

GameObject::GameObject ( )

Constructor

◆ ~GameObject()

GameObject::~GameObject ( )

Destructor

Member Function Documentation

◆ AddComponent()

void GameObject::AddComponent ( Component c)

Adds a component to this game object

◆ Input()

void GameObject::Input ( SDL_Event  e)

Gives inputs to any components of this game object that require input

Here is the call graph for this function:

◆ RemoveComponent()

void GameObject::RemoveComponent ( )

Removes a component from this game object

◆ Render()

void GameObject::Render ( SDL_Renderer *  renderer)

Renders any components of this game object that requires rendering

◆ Update()

void GameObject::Update ( )

Updates any components of this gaem object that require updating

Here is the call graph for this function:

Member Data Documentation

◆ m_components

std::vector<Component*> GameObject::m_components

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