Files
makefile_cpp/Make/2048/headers/statistics.hpp
2023-04-13 14:02:08 +08:00

35 lines
874 B
C++

#ifndef STATISTICS_H
#define STATISTICS_H
#include "global.hpp"
#include <iosfwd>
#include <string>
#include <tuple>
namespace Scoreboard {
struct Score;
}
namespace Statistics {
struct total_game_stats_t {
ull bestScore{};
ull totalMoveCount{};
int gameCount{};
double totalDuration{};
int winCount{};
};
using load_stats_status_t = std::tuple<bool, total_game_stats_t>;
load_stats_status_t loadFromFileStatistics(std::string filename);
ull load_game_best_score();
void saveEndGameStats(Scoreboard::Score finalscore);
void CreateFinalScoreAndEndGameDataFile(std::ostream &os, std::istream &is,
Scoreboard::Score finalscore);
} // namespace Statistics
std::istream &operator>>(std::istream &is, Statistics::total_game_stats_t &s);
std::ostream &operator<<(std::ostream &os, Statistics::total_game_stats_t &s);
#endif