import {Command} from "@colyseus/command"; import {CardGameState} from "../schema/CardGameState"; import {DrawCommand} from "./DrawCommand"; /** * 下一轮 */ export class NextTurnCommand extends Command { execute() { this.state.gameState = 2; this.state.subTurn = ''; const sessionIds = [...this.state.players.keys()]; this.state.currentTurn = (this.state.currentTurn) ? sessionIds[(sessionIds.indexOf(this.state.currentTurn) + 1) % sessionIds.length] : sessionIds[0]; return [new DrawCommand()] } }