15 lines
367 B
TypeScript
15 lines
367 B
TypeScript
import { Socket } from "socket.io-client";
|
|
import { ServerEvent } from "./ServerEvent";
|
|
import { PieceId } from "../constants/Pieces";
|
|
|
|
export type StartRoundEvent = {
|
|
pieceIds: PieceId[];
|
|
};
|
|
|
|
export function attachHandlerToStartRoundEvent(
|
|
socket: Socket,
|
|
handler: (event: StartRoundEvent) => void,
|
|
): void {
|
|
socket.once(ServerEvent.START_ROUND, handler);
|
|
}
|