-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
47 lines (43 loc) · 1.03 KB
/
types.ts
File metadata and controls
47 lines (43 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export type ScoreType = 'generic' | 'round-based' | 'win-lose';
export type Platform = 'boardgame' | 'ps5' | 'switch-1' | 'switch-2';
export interface Game {
id: string;
name: {
zh: string;
en: string;
};
platforms: Platform[]; // Changed to array to support both NS1 and NS2
players: {
min: number;
max: number;
};
duration: number; // in minutes
categories: string[];
scoreType: ScoreType;
description: string;
rules: string[];
twoPlayerRules?: string[];
links?: {
title: string;
url: string;
type: 'video' | 'official' | 'rulebook';
}[];
winCondition: string;
imageUrl?: string;
}
export interface Player {
id: number;
name: string;
score: number;
scores: Record<number, number>;
}
export interface GameSession {
sessionId: string;
gameId: string;
players: Player[];
status: 'setup' | 'ongoing' | 'finished';
currentRound: number;
totalRounds: number;
firstPlayerId?: number;
history?: { timestamp: number; playerId: number; change: number; round: number }[];
}