-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
47 lines (42 loc) · 936 Bytes
/
global.d.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
type Cell = {
player: 0 | 1 | 2
falling: boolean
}
type Score = {
player1: number
player2: number
}
interface IGameRoom {
hoveredColumn: number | null
boardState: Cell[][]
playerTurn: 1 | 2
time: number
isPaused: boolean
score: Score
currentPlayer: number | null
onStart: boolean
playerWin: 1 | 2 | null
winningPattern: number[][]
isOpen: boolean
}
type GameColumnProps = {
columnIndex: number;
col: GameCellType[];
onColumnHover: (columnIndex: number) => void;
onColumnClick: (rowIndex: number, columnIndex: number) => void;
hoveredColumn: number | null;
currentPlayer: number | null;
playerTurn: number;
winningPattern: number[][];
}
type GameCellProps = {
row: GameCellType;
columnIndex: number;
rowIndex: number;
onColumnClick: (rowIndex: number, columnIndex: number) => void;
winningPattern: number[][];
}
type GameCellType = {
player: number;
falling: boolean;
}