Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SM_EndGame Class Reference

A State that contains and runs the End Game Menu. More...

#include <SM_EndGame.h>

Inheritance diagram for SM_EndGame:
Inheritance graph
Collaboration diagram for SM_EndGame:
Collaboration graph

Public Member Functions

 SM_EndGame (S_StateManager *stateManager, SDL_Renderer *renderer, C_Vec2 dimensions, C_Music *backgroundMusic, int score)
 Constructs the State object. More...
 
 ~SM_EndGame ()
 Destructs the State object. More...
 
bool input ()
 Handles the State input. More...
 
void update (float dt)
 A function to update the State. More...
 
void draw ()
 A function to draw the State to the screen. More...
 
- Public Member Functions inherited from S_State
 S_State (S_StateManager *stateManager, SDL_Renderer *renderer, C_Vec2 dimensions)
 Constructs the State object. More...
 
virtual ~S_State ()
 A virtual destructor for the State object. More...
 

Private Member Functions

void loadScores ()
 A function to load in the scores. More...
 
void compareScores (int score)
 A function to compare the scores. More...
 
void writeScores ()
 A function to write out the scores. More...
 

Private Attributes

C_MusicbackgroundMusic
 The background music. More...
 
C_Texturebackground
 The Background Image. More...
 
C_TexturebuttonBackground
 The Button Background Image. More...
 
float * universalSpeed
 A pointer for the universal speed of the menu. More...
 
std::vector< std::string > scores
 A std::vector of the loaded scores. More...
 
UI_ButtonretryButton
 The retry Button. More...
 
UI_ButtonexitButton
 The Exit Button. More...
 
C_TexturegameOver
 The Game Over Image. More...
 
C_Texturecoin
 The Coin Image. More...
 
C_TextscoreText
 The Score text. More...
 
C_Vec2 coinDim
 The dimensions of the coin image. More...
 
float buttonYPos [1]
 
bool updateScores
 

Additional Inherited Members

- Protected Attributes inherited from S_State
S_StateManagerstateManager
 A pointer to the state manager. More...
 
SDL_Renderer * renderer
 A pointer to the renderer. More...
 
C_Vec2 dimensions
 The screen dimensions. More...
 

Detailed Description

A State that contains and runs the End Game Menu.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

SM_EndGame::SM_EndGame ( S_StateManager stateManager,
SDL_Renderer *  renderer,
C_Vec2  dimensions,
C_Music backgroundMusic,
int  score 
)

Constructs the State object.

Parameters
stateManagerA pointer to the StateManager.
rendererA pointer to the renderer.
dimensionsThe screen dimensions.
backgroundMusicThe background music of the State.
scoreThe most score from the last game.

Here is the call graph for this function:

SM_EndGame::~SM_EndGame ( )

Destructs the State object.

Member Function Documentation

void SM_EndGame::compareScores ( int  score)
private

A function to compare the scores.

Parameters
scoreThe new score to compare to the old scores.

Here is the caller graph for this function:

void SM_EndGame::draw ( )
virtual

A function to draw the State to the screen.

Implements S_State.

Here is the call graph for this function:

bool SM_EndGame::input ( )
virtual

Handles the State input.

Returns
If false then quit the State.

Implements S_State.

Here is the call graph for this function:

void SM_EndGame::loadScores ( )
private

A function to load in the scores.

Here is the caller graph for this function:

void SM_EndGame::update ( float  dt)
virtual

A function to update the State.

Parameters
dtThe delta time.

Implements S_State.

Here is the call graph for this function:

void SM_EndGame::writeScores ( )
private

A function to write out the scores.

Here is the caller graph for this function:

Member Data Documentation

C_Texture* SM_EndGame::background
private

The Background Image.

C_Music* SM_EndGame::backgroundMusic
private

The background music.

C_Texture* SM_EndGame::buttonBackground
private

The Button Background Image.

float SM_EndGame::buttonYPos[1]
private
C_Texture* SM_EndGame::coin
private

The Coin Image.

C_Vec2 SM_EndGame::coinDim
private

The dimensions of the coin image.

UI_Button* SM_EndGame::exitButton
private

The Exit Button.

C_Texture* SM_EndGame::gameOver
private

The Game Over Image.

UI_Button* SM_EndGame::retryButton
private

The retry Button.

std::vector<std::string> SM_EndGame::scores
private

A std::vector of the loaded scores.

C_Text* SM_EndGame::scoreText
private

The Score text.

float* SM_EndGame::universalSpeed
private

A pointer for the universal speed of the menu.

bool SM_EndGame::updateScores
private

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