Game Engine 2D Platformer
Public Member Functions | Public Attributes | List of all members
ScoreDisplayComponent Class Reference

ScoreDisplayComponent class used to show a GameEntity's score. More...

#include <ScoreDisplayComponent.hpp>

Inheritance diagram for ScoreDisplayComponent:
Inheritance graph
[legend]
Collaboration diagram for ScoreDisplayComponent:
Collaboration graph
[legend]

Public Member Functions

 ScoreDisplayComponent (SDL_Renderer *ren)
 Constuctor for ScoreDisplayComponent. More...
 
 ~ScoreDisplayComponent ()
 Destructor for ScoreDisplayComponent. More...
 
void StartUp ()
 Initializes the attributes for ScoreDisplayComponent. More...
 
void ShutDown ()
 Destroys and frees attributes for ScoreDisplayComponent. More...
 
void Update (GameEntity &entity)
 Updates the ScoreDisplayComponent. More...
 
void Render (GameEntity &entity)
 Renders the ScoreDisplayComponent. More...
 
- Public Member Functions inherited from Component
 Component ()=default
 Constuctor for Component class. More...
 
virtual void LoadImage (std::string filepath, SDL_Renderer *ren)
 To initalize loadImages for children classes. More...
 
virtual void HandleEvent (GameEntity &entity)
 Handle the events of GameEntity object for children classes. More...
 

Public Attributes

SDL_Rect rect1
 
SDL_Rect rect2
 
SDL_Rect backgroundRect
 

Detailed Description

ScoreDisplayComponent class used to show a GameEntity's score.

Constructor & Destructor Documentation

◆ ScoreDisplayComponent()

ScoreDisplayComponent::ScoreDisplayComponent ( SDL_Renderer *  ren)

Constuctor for ScoreDisplayComponent.

◆ ~ScoreDisplayComponent()

ScoreDisplayComponent::~ScoreDisplayComponent ( )

Destructor for ScoreDisplayComponent.

Member Function Documentation

◆ Render()

void ScoreDisplayComponent::Render ( GameEntity entity)
virtual

Renders the ScoreDisplayComponent.

Updates score display depending on GameEntity's score.

Parameters
entityGameEntity Object
GameEntity&entity

Reimplemented from Component.

◆ ShutDown()

void ScoreDisplayComponent::ShutDown ( )
virtual

Destroys and frees attributes for ScoreDisplayComponent.

Reimplemented from Component.

◆ StartUp()

void ScoreDisplayComponent::StartUp ( )
virtual

Initializes the attributes for ScoreDisplayComponent.

Reimplemented from Component.

◆ Update()

void ScoreDisplayComponent::Update ( GameEntity entity)
virtual

Updates the ScoreDisplayComponent.

Renders score to screen.

Parameters
entityGameEntity Object
GameEntity&entity

Implements Component.

Member Data Documentation

◆ backgroundRect

SDL_Rect ScoreDisplayComponent::backgroundRect

◆ rect1

SDL_Rect ScoreDisplayComponent::rect1

◆ rect2

SDL_Rect ScoreDisplayComponent::rect2

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