Stone_Development/ScoreManager.h
2025-12-01 14:37:35 +01:00

26 lines
581 B
C++

#pragma once
#include <string>
#include <limits>
class ScoreManager {
public:
ScoreManager(const std::string& filename);
void incrementScore();
void resetScore();
void saveHighScore(int finalScore, double finalTime);
int getCurrentScore() const { return currentScore; }
int getHighScore() const { return highScore; }
double getBestTime() const { return bestTime; }
private:
int currentScore = 0;
int highScore = std::numeric_limits<int>::max();
double bestTime = std::numeric_limits<double>::max();
std::string highscoreFile;
void loadHighscore();
};