Memento-based undo/redo with full encounter snapshots. Undo stack capped at 50 entries, persisted to localStorage. Triggered via buttons in the top bar (inboard of turn navigation) and keyboard shortcuts (Ctrl+Z / Ctrl+Shift+Z, Cmd on Mac, case-insensitive key matching). Clear encounter resets both stacks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
563 B
TypeScript
28 lines
563 B
TypeScript
import type {
|
|
Creature,
|
|
CreatureId,
|
|
Encounter,
|
|
PlayerCharacter,
|
|
UndoRedoState,
|
|
} from "@initiative/domain";
|
|
|
|
export interface EncounterStore {
|
|
get(): Encounter;
|
|
save(encounter: Encounter): void;
|
|
}
|
|
|
|
export interface BestiarySourceCache {
|
|
getCreature(creatureId: CreatureId): Creature | undefined;
|
|
isSourceCached(sourceCode: string): boolean;
|
|
}
|
|
|
|
export interface PlayerCharacterStore {
|
|
getAll(): PlayerCharacter[];
|
|
save(characters: PlayerCharacter[]): void;
|
|
}
|
|
|
|
export interface UndoRedoStore {
|
|
get(): UndoRedoState;
|
|
save(state: UndoRedoState): void;
|
|
}
|