Building Game Engines
Public Member Functions | List of all members
Component Class Referenceabstract

#include <Component.hpp>

Inheritance diagram for Component:
Inheritance graph
Collaboration diagram for Component:
Collaboration graph

Public Member Functions

 Component ()
 
virtual ~Component ()=0
 
virtual void Update ()=0
 
virtual void Render (SDL_Renderer *renderer)=0
 

Detailed Description

An abstract class that represents any Component that a GameObject may have.

Constructor & Destructor Documentation

◆ Component()

Component::Component ( )

Default constructor. Should never be called directly.

◆ ~Component()

Component::~Component ( )
pure virtual

Pure virtual Destructor.

Member Function Documentation

◆ Render()

virtual void Component::Render ( SDL_Renderer *  renderer)
pure virtual

Pure virtual Render Method. Renderer is the game's renderer. Renders the Component if there is a visual component.

Implemented in TileMap, CollisionComponent, AIControllerComponent, PhysicsComponent, Sprite, Background, ControllerComponent, TransformComponent, and CollectibleComponent.

◆ Update()

virtual void Component::Update ( )
pure virtual

Pure virtual Update Method. Performs any updates needed to this component each frame.

Implemented in TileMap, CollisionComponent, AIControllerComponent, PhysicsComponent, Sprite, Background, ControllerComponent, TransformComponent, and CollectibleComponent.


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