-
Notifications
You must be signed in to change notification settings - Fork 2
/
model.ts
51 lines (41 loc) · 830 Bytes
/
model.ts
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
48
49
50
51
export interface Hand {
cards: Card[];
score: number;
}
export interface Card {
code: string;
image: string;
}
export interface Room {
id: number;
name: string;
players: PlayerWithStatus[];
bank: PlayerStatus;
full: boolean;
}
export interface Player {
id: string;
name: string;
score: number;
}
export interface PlayerWithStatus {
player: Player;
status: PlayerStatus;
}
export interface PlayerStatus {
hand: Hand;
move: Move;
canDo: Action[];
}
export type Action = 'draw' | 'stay';
export type Move = 'wait' | 'in-game' | 'burst' | 'draw' | 'stay' | 'timeout' ;
export interface RoomEvent {
type: string;
round?: number;
step?: number;
room?: Room;
roomId?: number;
player?: Player;
winners?: string;
action?: Move;
}