commit #2
This commit is contained in:
parent
360b36874c
commit
e80536cf67
5 changed files with 14 additions and 7 deletions
|
@ -1,7 +0,0 @@
|
||||||
import EventEmitter from "eventemitter3"
|
|
||||||
|
|
||||||
interface Events {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export const eventBus = new EventEmitter()
|
|
14
src/server/game.ts
Normal file
14
src/server/game.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import EventEmitter from "eventemitter3"
|
||||||
|
import type { GameAction } from "../shared/gameActions"
|
||||||
|
|
||||||
|
export const gameActionsBus = new EventEmitter<Record<string, [GameAction]>>()
|
||||||
|
|
||||||
|
interface Events {
|
||||||
|
broadcastAction: [GameAction]
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Game extends EventEmitter<Events> {
|
||||||
|
constructor(public id: string) {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
}
|
0
src/shared/game/state.ts
Normal file
0
src/shared/game/state.ts
Normal file
Loading…
Add table
Reference in a new issue