batched round: queue actions/diplomacy, jump forward commits one turn (v0.2.0)
CI / build + unit + e2e (pull_request) Successful in 1m51s
CI / build + unit + e2e (pull_request) Successful in 1m51s
This commit is contained in:
@@ -74,6 +74,17 @@ export interface EventEntry {
|
||||
outcome: EventOutcome;
|
||||
}
|
||||
|
||||
/**
|
||||
* A single item queued in the current round, waiting to be committed by a
|
||||
* "Jump forward". `kind: 'action'` is a free-text player move; `kind:
|
||||
* 'diplomacy'` is a message to a specific nation (`to`).
|
||||
*/
|
||||
export type RoundItem = {
|
||||
kind: 'action' | 'diplomacy';
|
||||
text: string;
|
||||
to?: string;
|
||||
};
|
||||
|
||||
/** The full, persisted state of one game. Saved to SQLite by id. */
|
||||
export interface GameState {
|
||||
id: string;
|
||||
@@ -84,6 +95,12 @@ export interface GameState {
|
||||
date: string;
|
||||
nations: Record<string, Nation>;
|
||||
events: EventEntry[];
|
||||
/**
|
||||
* Actions + diplomatic messages queued this round but not yet committed.
|
||||
* Adding an item never advances the turn; a "Jump forward" processes the whole
|
||||
* batch in a single turn and clears this back to `[]`.
|
||||
*/
|
||||
pending: RoundItem[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user