ELEC2645 (2018/19) / Mbed 2 deprecated EL17MCD

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Scores Class Reference

Scores Class Reference

Menus Class. More...

#include <Scores.h>

Public Member Functions

 Scores ()
 Constructor.
 ~Scores ()
 Destructor.
float score_calculator (int turns, int health)
 Calculate's the winner's score based on number of turns played and initial health.
void display_score (float current, N5110 &lcd)
 Displays the winner's score on the screen.
void display_top_scores (N5110 &lcd)
 Displays the highest three score on the screen.

Detailed Description

Menus Class.

Calculates, ranks and displays the players' scores.

Author:
Maxim C. Delacoe
Date:
April 2019

Definition at line 14 of file Scores.h.


Constructor & Destructor Documentation

Scores (  )

Constructor.

Sets the highscores to 0.

Definition at line 8 of file Scores.cpp.

~Scores (  )

Destructor.

Non user specified.

Definition at line 15 of file Scores.cpp.


Member Function Documentation

void display_score ( float  current,
N5110 lcd 
)

Displays the winner's score on the screen.

Parameters:
currentThe concluding score for the current game
lcdThe lcd object from N5110 class.

Definition at line 27 of file Scores.cpp.

void display_top_scores ( N5110 lcd )

Displays the highest three score on the screen.

Parameters:
lcdThe lcd object from N5110 class.

Definition at line 35 of file Scores.cpp.

float score_calculator ( int  turns,
int  health 
)

Calculate's the winner's score based on number of turns played and initial health.

Parameters:
turnsThe number of turns the game has elapsed
healthThe initial health of the tanks

Definition at line 20 of file Scores.cpp.