feat(offline): local game source (Phase B3.1) #193
Reference in New Issue
Block a user
Delete Branch "feature/offline-game-seam"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase B3.1 of PWA offline mode, on top of #192. A
GatewayClient-shaped facade over the offline engine, so the same game screen can drive a local vs_ai game with no backend. Wiring intoGame.svelteis B3.2 (next PR).source.ts:LocalSourceimplements the game-loop subset (GameLoopSource) for a local game id —gameState/gameHistoryvia replay;submitPlay/pass/exchange/resignapply the human move then run the robot (decide(generateMoves)) synchronously, persist both, and deliver the robot move via a per-game event emitter (no live stream);hintgated to >30 min since the robot last moved;evaluate/checkWordlocal. Glyph⇄index via the static letters.ruleset.ts: static per-variant letters table (glyphs), pinned to the Go alphabet — offline now fully self-contained.engine.ts:submitPlay(infers direction),evaluatePlay+dictionaryHas, and record the main-word coord + words on a play.source.test.ts: create → human pass → synchronous robot reply via the event, the hint gate, decoded history, a whole game to completion.Pure additive library code; no runtime behavior change (bundle unchanged). Local verify green: backend build/vet/gofmt; UI check + test:unit (459) + build.