Scaffold monorepo: engine, server, and web packages
npm workspaces with three TypeScript packages: @wizwar/engine (pure game logic), @wizwar/server (Node websocket authority), @wizwar/web (Svelte 5 + Vite client). Server handshake and client build verified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// @wizwar/engine — pure, deterministic game logic. No I/O, no timers, no
|
||||
// network: the server drives it in real time, the async mode replays it from
|
||||
// stored commands, and future AI players call it to evaluate moves.
|
||||
//
|
||||
// Card data, board layouts, and precise rule mechanics are pending
|
||||
// transcription of the 6th edition materials (see /research).
|
||||
|
||||
export interface PlayerId {
|
||||
readonly id: string;
|
||||
}
|
||||
|
||||
/** A single square on a sector board. Walls live on edges between squares. */
|
||||
export interface Position {
|
||||
readonly x: number;
|
||||
readonly y: number;
|
||||
}
|
||||
|
||||
export type GamePhase = "setup" | "playing" | "finished";
|
||||
|
||||
export interface GameState {
|
||||
readonly phase: GamePhase;
|
||||
readonly turn: number;
|
||||
readonly activePlayer: string;
|
||||
// TODO: board (sectors, walls, doors), players (position, life, hand,
|
||||
// sustained spells, carried items/treasures), deck & discard, RNG seed.
|
||||
}
|
||||
|
||||
/** Commands are player intents; the engine validates and applies them. */
|
||||
export type Command = { type: "todo" };
|
||||
|
||||
/** Events are what actually happened; clients render from these. */
|
||||
export type GameEvent = { type: "todo" };
|
||||
Reference in New Issue
Block a user