Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

HighScore Class Reference

HighScore Class Reference

High Score class. More...

#include <HighScore.h>

Inherits SDErrors.

Public Member Functions

 HighScore ()
 Constructor.
 ~HighScore ()
 Destructor.
void init ()
 Initialises HighScore.
void save_new_high_score (SDFileSystem &sd, N5110 &lcd, int new_high_score)
 Saves the sore if a new High score.
int read_high_score (SDFileSystem &sd)
 Reads and returns the highest score.
void no_high_scores (N5110 &lcd)
 Draws no high scores screen.
void run_save_test (SDFileSystem &sd, N5110 &lcd)
 Runs the save test unit test.
bool get_error ()
 Gets error flag.
void set_error (bool error)
 Set error.

Protected Attributes

bool error_
 Flag for error,.

Detailed Description

High Score class.

Displays the highest score

Author:
Benjamin Evans, University of Leeds
Date:
May 2020

Definition at line 16 of file HighScore.h.


Constructor & Destructor Documentation

HighScore (  )

Constructor.

Definition at line 3 of file HighScore.cpp.

~HighScore (  )

Destructor.

Definition at line 7 of file HighScore.cpp.


Member Function Documentation

bool get_error (  ) [inherited]

Gets error flag.

Returns:
error_;

Definition at line 4 of file SDErrors.cpp.

void init (  )

Initialises HighScore.

Definition at line 47 of file HighScore.cpp.

void no_high_scores ( N5110 lcd )

Draws no high scores screen.

Parameters:
lcdN5110 object

Definition at line 51 of file HighScore.cpp.

int read_high_score ( SDFileSystem sd )

Reads and returns the highest score.

Parameters:
sdsd card object
Returns:
high_score

Definition at line 90 of file HighScore.cpp.

void run_save_test ( SDFileSystem sd,
N5110 lcd 
)

Runs the save test unit test.

Parameters:
lcdN5110 object
sdsd card object

Definition at line 28 of file HighScore.cpp.

void save_new_high_score ( SDFileSystem sd,
N5110 lcd,
int  new_high_score 
)

Saves the sore if a new High score.

Parameters:
lcdN5110 object
sdsd card object
new_high_score

Definition at line 71 of file HighScore.cpp.

void set_error ( bool  error ) [inherited]

Set error.

Parameters:
error;

Definition at line 8 of file SDErrors.cpp.


Field Documentation

bool error_ [protected, inherited]

Flag for error,.

Note:
true = error

Definition at line 33 of file SDErrors.h.