libscid snapshot+b450b7969924
Chess applications made easy.
Source on GitHub License GPL v2
Loading...
Searching...
No Matches
Game

scid::core::Game is the editable aggregate for one chess game. It owns the structured header, the optional non-standard start position, and the recursive movetext tree. Read-only traversal, mutable editing, PGN import/export, and position replay all work through that aggregate rather than owning separate game state.

The aggregate view is the compact map of the game-facing API. Text formats such as PGN and notation sit outside the aggregate; cursors provide traversal and editing; the Game root owns header data, movetext, and any non-standard start position needed to replay the game.

Domain Model

This diagram expands the aggregate map into the main public types that make up the game model. It is intentionally loose: it shows ownership, recursion and API edges, while omitting most operations and low-level chess primitives. Header data is structured first, with supplemental PGN tags kept beside the typed fields rather than replacing them.

Movetext is recursive: the mainline is a MoveSequence, each Move can own child Variation objects, and each variation owns another MoveSequence. GameCursor and MovetextCursor are bound to a Game; they do not own an independent copy of the movetext. PGN and notation remain text mappings around the aggregate: they parse into, encode from, or interpret the game state instead of being part of the aggregate.