13 lines
435 B
TypeScript
13 lines
435 B
TypeScript
import { Command } from "@colyseus/command";
|
|
import { CardGameState } from "../schema/CardGameState";
|
|
import {ChildAsyncCommand} from "./ChildAsyncCommand";
|
|
|
|
export class EnqueueAsyncCommand extends Command<CardGameState, { count: number }> {
|
|
async execute({ count }: {count: number}) {
|
|
this.state.round = 0;
|
|
|
|
return [...Array(count)].map(_ =>
|
|
new ChildAsyncCommand().setPayload({ i: count }));
|
|
}
|
|
}
|