Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

HighScore/HighScore.h

Committer:
evanso
Date:
2020-05-24
Revision:
78:6a6c93c19ed1
Parent:
76:6daba3002424
Child:
79:66bcf8fa2d2d

File content as of revision 78:6a6c93c19ed1:

#ifndef HIGHSCORE_H
#define HIGHSCORE_H

// Included libraries ----------------------------------------------------------
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "SDFileSystem.h"
#include "Sprites.h"
#include "SDErrors.h"

/** High Score class
 * @brief Displayes the highest score
 * @author Benjamin Evans, University of Leeds
 * @date May 2020
 */      
class  HighScore:public SDErrors{
    public:
        /** Constructor */
         HighScore();
        
        /** Destructor */
        ~HighScore();
        
        /** Initalises HighScore
         */
        void init();
        
        /** Saves the the sore if a new High score 
         * @param lcd @details N5110 object
         * @param sd @details sd card object
         * @param new_high_score
         */
        void save_new_high_score(SDFileSystem &sd, N5110 &lcd, 
        int new_high_score);
        
        /** Reads and returns the hgihest score
         * @param sd @details sd card object
         * @return high_score
         */
        int read_high_score(SDFileSystem &sd);
        
        /** Draws no high scores screen
         * @param lcd @details N5110 object
         */
        void no_high_scores(N5110 &lcd);
        
    private:   
    // Function prototypes -----------------------------------------------------
        
        /** shows error if high data files opens incorrectly
         * @param lcd @details N5110 object
         */
        void error_open_file(N5110 &lcd);
        
};
#endif