diff options
Diffstat (limited to 'types.d.ts')
-rw-r--r-- | types.d.ts | 30 |
1 files changed, 12 insertions, 18 deletions
@@ -10,6 +10,12 @@ export type CardId = Brand<number, 'CardId'>; export type FactionId = Brand<string, 'FactionId'>; export type FrontId = 'a' | 'm' | 'n' | 's'; +export interface Front { + value: number; + contributions: FactionId[]; + status: 'Victory' | 'Defeat' | null; +} + export interface Game { [index: number]: any; seed: number; @@ -17,7 +23,7 @@ export interface Game { undo: Game[]; turn: number; year: number; - active: Player | null; + active: Player | 'None' | null; state: string | null; bag_of_glory: FactionId[]; blank_markers: number[][]; @@ -27,22 +33,10 @@ export interface Game { discard: Record<FactionId | 'f', number[]>; engine: EngineNode[]; fronts: { - a: { - value: number; - contributions: FactionId[]; - }; - m: { - value: number; - contributions: FactionId[]; - }; - n: { - value: number; - contributions: FactionId[]; - }; - s: { - value: number; - contributions: FactionId[]; - }; + a: Front; + m: Front; + n: Front; + s: Front; }; glory: FactionId[]; hands: Record<FactionId, CardId[]>; @@ -112,7 +106,7 @@ export interface SeqNode { export interface LeafNode { t: 'l'; s: string; // State - p: FactionId; // Player + p: FactionId | 'None'; // Player a?: any; // args r?: 0 | 1; // 1 if resolved } |