Release 1.0.0: rename to NoMines, add leaderboard, theme support and release metadata
- Rename app/binary/app-id to nomines (io.github.bemagri.nomines), config dir moves to ~/.config/nomines with legacy path fallback - Add persistent best-time leaderboard (Glib::KeyFile) - Theme-aware board following system light/dark preference - Beveled 3D cells, confetti win animation, keyboard shortcuts, right-click chording, per-difficulty window sizing - Add AppStream metainfo, validate desktop file and metainfo via meson tests - Fix license metadata to GPL-3.0-or-later and real homepage
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
// Persistent best times, stored as a GKeyFile under the user config dir:
|
||||
// ~/.config/minesweeper/leaderboard.ini (gitignored)
|
||||
class Leaderboard {
|
||||
public:
|
||||
// Records a finished game. Returns true when it is a new best time
|
||||
// for the difficulty; the file is saved immediately.
|
||||
bool record(const std::string& difficulty, int seconds);
|
||||
|
||||
// Best time in seconds for the difficulty, if one exists.
|
||||
std::optional<int> best_time(const std::string& difficulty) const;
|
||||
|
||||
private:
|
||||
void load();
|
||||
void save();
|
||||
|
||||
std::map<std::string, int> times_;
|
||||
bool loaded_ = false;
|
||||
};
|
||||
Reference in New Issue
Block a user