Expand description
A game’s history: the state it started in and every command applied
since. Its rules are deterministic (TurnRules), so any earlier point
is rebuilt by replaying, which is what replays, rewinds and saving a
game in progress need. What a rewind costs, if anything, is the game’s.
§Rules
- Points. Point
nis the game after its firstncommands (History::state_at); point 0 is the state it started in. Rewinding to pointn(History::rewind_to) forgets commandnand every one after it. - A refused command replays as nothing, as it changed nothing when it was sent; a history that recorded one by mistake replays as if it had not.
- Saving. A history is written as its first state and its
commands:
(initial: …, commands: [ … ]).
Structs§
- History
- A game’s first state and the commands applied since, oldest first.
- NoSuch
Point - Why a rewind was refused: there is no earlier point
n(it must be below the number of commands). Nothing changed. - Replayed
- One past command, replayed (
History::replay).