summaryrefslogtreecommitdiff
path: root/types.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'types.d.ts')
-rw-r--r--types.d.ts30
1 files changed, 12 insertions, 18 deletions
diff --git a/types.d.ts b/types.d.ts
index da8fe25..f0c4772 100644
--- a/types.d.ts
+++ b/types.d.ts
@@ -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
}