Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

HighScore/HighScore.h

Committer:
evanso
Date:
2020-05-24
Revision:
76:6daba3002424
Parent:
75:643a509cf9ed
Child:
78:6a6c93c19ed1

File content as of revision 76:6daba3002424:

#ifndef HIGHSCORE_H
#define HIGHSCORE_H

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

/** High Score class
 * @brief Displayes the highest score
 * @author Benjamin Evans, University of Leeds
 * @date May 2020
 */      
class  HighScore{
    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);
        
        
    // Accessors and mutators --------------------------------------------------
        
        /** Gets error flag
         * @return error_;
         */
        bool get_error();
        
         /** set error
         * @param error;
         */
        void set_error(bool error);
        
    private:   
    // Function prototypes -----------------------------------------------------
        
        /** shows error if high data files opens incorrectly
         * @param lcd @details N5110 object
         */
        void error_open_file(N5110 &lcd);
        
 
    // Varibles ---------------------------------------------------------------- 
        
        /** Flag for error, true = error */
        bool error_;
        
};
#endif