-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathglobals.ts
More file actions
25 lines (22 loc) · 727 Bytes
/
globals.ts
File metadata and controls
25 lines (22 loc) · 727 Bytes
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
type Context = typeof MessageParser.globalContext;
type Player = typeof Games.selfPlayer;
type Room = typeof Rooms.globalRoom;
type User = typeof Users.self;
interface AnyObject {[k: string]: any}
interface Command {
(this: Context, target: string, room: Room | User, user: User, cmd: string, time: number): void;
}
class BaseGame {
onSignups?(): void
onStart?(): void
onNextRound?(): void
onEnd?(): void
onChildEnd?(winners: Map<Player, number>): void
onJoin?(player: Player, lateJoin?: boolean): void
onLeave?(player: Player): void
onRename?(player: Player): void
setAnswers?(): void
pointsPerAnswer?(answer: string): number
filterGuess?(guess: string): boolean
onGuess?(guess: string, player: Player): void
}