feat: bootstrap walking skeleton

This commit is contained in:
ginnoir
2026-06-11 17:06:52 -05:00
commit ec8f857845
44 changed files with 6677 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { create } from 'zustand';
import type { GameView } from './viewModel';
/**
* The view store. The runtime owns the authoritative engine state and pushes a
* fresh view snapshot here at ~10 fps; React components subscribe to slices of
* it. The store is a dumb mirror plus an event log — no game logic lives here.
*/
const MAX_LOG_LINES = 50;
export interface GameStoreState extends GameView {
log: string[];
setView: (view: GameView) => void;
appendLog: (line: string) => void;
}
export const useGameStore = create<GameStoreState>((set) => ({
resources: [],
activeActionId: null,
actionName: null,
actionProgress: 0,
log: [],
setView: (view) => set(view),
appendLog: (line) => set((state) => ({ log: [...state.log, line].slice(-MAX_LOG_LINES) })),
}));