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

Notation is the location-level text import/export mapping around scid::core::Game and scid::core::Position. PGN handles whole-game import and export; notation answers narrower questions at a MovetextLocation: what is the current UCI position command, what is the previous or next move in UCI notation, and what SAN should be displayed for the move beside the cursor?

The notation helpers start with a Game and a MovetextLocation. They restore a GameCursor, replay the moves needed to reach that location, and use Position as the resolver for board-sensitive text. UCI move text comes directly from stored MoveSpec values; SAN prefers cached Move::san text and falls back to Position::makeSan() when the move must be regenerated.

notation::currentPositionUci() emits a complete UCI position command for the current location. Standard-start games use startpos; non-standard starts and positions after null moves are emitted from FEN. The position API supplies the lower-level text operations: reading FEN or UCI-position strings, parsing SAN-like or coordinate moves into MoveSpec, generating SAN, applying coordinate move lists, and printing FEN.

Domain Model

This diagram expands notation into the public helpers and the domain objects they depend on. It is intentionally loose: notation has no aggregate of its own. It is a mapping layer that restores a cursor location, derives a position, and formats text from the move or board state at that point.

currentPositionUci(), previousMoveUci() and nextMoveUci() are coordinate or UCI helpers. They read stored MoveSpec values and, for full position commands, replay from the effective start position. previousSan() and nextSan() are board-sensitive: they must know the position before the move, and they return an empty string when the move cannot be replayed legally.

The Position text API is the lower-level half of the same mapping. ReadFromFEN() and ReadFromFENorUCI() build board state from text; parseMoveSpec() and readCoordinateMoveSpec() turn input notation into a portable move request; makeSan() and PrintFEN() turn position state back into text.