import {Command} from "@colyseus/command"; import {CardGameState} from "../schema/CardGameState"; import {Client} from "colyseus"; import {PlayReadyCommand} from "./PlayReadyCommand"; export class GameRestartCommand extends Command { execute({client} = this.payload) { this.state.restartCount ++; if (this.state.restartCount >= this.room.maxClients) { this.room.stopSchedule('restart_schedule'); } return [new PlayReadyCommand().setPayload({client})]; } }