-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.ts
155 lines (138 loc) · 2.87 KB
/
types.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
export enum LimbEnum {
LeftArm,
RightArm,
LeftLeg,
RightLeg,
}
export enum PoseEnum {
Straight,
BentUp,
BentDown,
}
export type StageCardProps = {
activeCardIndex: number;
color: string;
leftOffset?: string;
z?: string;
active?: boolean;
limbs: number[];
shown: boolean;
index: number;
rotate?: string;
attract?: boolean;
attractActive: boolean;
game: any;
};
export type PlayerDetailsProps = {
children?: React.ReactNode;
showScore?: boolean;
displayName?: string;
scoreForRound?: number;
};
export type ActiveCardProps = {
activeCard: CardProps | null;
};
export type StageContainerProps = {
children?: React.ReactNode;
game?: any;
};
export type ControlsProps = {
children?: React.ReactNode;
game?: any;
playerId?: string;
player: Player;
yourPlayerId?: string;
activeCardIndex: number;
controlsColor?: string;
};
export type DanceFloorProps = {
children?: React.ReactNode;
game: any; // Replace 'any' with the actual type of your game state
};
export enum LimbPose {
Straight = 1,
BentUp = 2,
BentDown = 3,
}
export type Player = {
playerId: string;
playerColor: string;
totalScore: number;
scoreForRound: number;
index?: number;
limbs: LimbEnum[];
correctStreak: number;
controlsOrder: string[];
autoLimb: boolean;
attract: boolean;
displayName?: string;
playerPosition?: string;
win: boolean;
};
export type CardProps = {
color: string;
limbs: LimbEnum[];
};
export type DeckProps = {
game: any;
activeCardIndex: number;
player: Player;
};
export interface GameState {
count: number;
currentPlayerIndex?: number;
progress: number;
remainingTime?: number;
currentRound: number;
activeCard: CardProps | null;
cardStack: CardProps[];
winner?: string | null;
players: Player[];
testNum?: number;
gameOver: boolean;
attractActive: boolean;
activeCardIndex: number;
roundOver: boolean;
timeInSeconds: number;
testActionTriggered: boolean;
}
export type GameActions = {
getStreak?: () => number;
resetStreak: () => void;
shuffleEnemyControls: () => void;
toggleAutoLimb: (params: { activeCardIndex: number }) => void;
toggleAttract: () => void;
toggleLimb: (params: { limb: LimbEnum }) => void;
};
export type CharacterProps = {
player: Player;
displayName?: string;
yourPlayerId: string;
currentRound: number;
};
export type LimbProps = {
limb: LimbEnum;
limbPoses?: {
leftArm: number;
rightArm: number;
leftLeg: number;
rightLeg: number;
};
player: Player;
};
export type BodyProps = {
children: React.ReactElement<LimbProps>[] | React.ReactElement<LimbProps>;
player: Player;
currentRound: number;
};
export type PowerUpsProps = {
children?: React.ReactNode;
game?: any;
player: Player;
activeCardIndex: number;
};
export type LimbControlsProps = {
children?: React.ReactNode;
game?: any;
player: Player;
};