app/game_recorder.h¶
turns a played game into an archived one (PLAN §4).
A GameSessionListener that accumulates the move list as the game runs and hands a finished GameRecord to a sink on game-over. Attach one to the session and every finished game is archived; attach none and nothing is.
Only finished games are recorded. A game abandoned mid-play (stopped, reset, the board unplugged) is dropped: a review list of half-games nobody chose to finish is noise, and an incomplete record would still claim a result.
-
namespace kirin
-
class GameRecorder : public kirin::GameSessionListener¶
- #include <game_recorder.h>
Public Types
-
using Sink = std::function<void(const GameRecord&)>¶
Public Functions
-
inline void setPendingUpload(bool on)¶
-
virtual void onGameStarted(const GameStartInfo&) override¶
-
virtual void onGameOver(const GameOverInfo&) override¶
-
inline const GameRecord ¤t() const¶
-
using Sink = std::function<void(const GameRecord&)>¶
-
class GameRecorder : public kirin::GameSessionListener¶