删除无用代码

This commit is contained in:
zhl 2020-12-07 16:43:34 +08:00
parent 7f59ffe0a5
commit 10cb2a1362
4 changed files with 0 additions and 82 deletions

View File

@ -1,13 +0,0 @@
import { Command } from "@colyseus/command";
import { CardGameState } from "../schema/CardGameState";
export class ChildAsyncCommand extends Command<CardGameState, { i: number }> {
async execute({ i }: {i: number}) {
await new Promise((resolve) => {
setTimeout(() => {
this.state.round += i;
resolve();
}, 100)
})
}
}

View File

@ -1,8 +0,0 @@
import { Command } from "@colyseus/command";
import { CardGameState } from "../schema/CardGameState";
export class ChildCommand extends Command<CardGameState, { i: number }> {
execute({ i }: {i: number}) {
this.state.round += i;
}
}

View File

@ -1,32 +0,0 @@
import { Command } from "@colyseus/command";
import { CardGameState } from "../schema/CardGameState";
export class DeepAsync extends Command<CardGameState> {
async execute() {
this.state.i = 0;
return [new DeepOneAsync(), new DeepOneAsync()];
}
}
export class DeepOneAsync extends Command<CardGameState> {
async execute() {
await this.delay(100);
this.state.i += 1;
return [new DeepTwoAsync()];
}
}
export class DeepTwoAsync extends Command<CardGameState> {
async execute() {
await this.delay(100);
this.state.i += 10;
return [new DeepThreeAsync()];
}
}
export class DeepThreeAsync extends Command<CardGameState> {
async execute() {
await this.delay(100);
this.state.i += 100;
}
}

View File

@ -1,29 +0,0 @@
import { Command } from "@colyseus/command";
import { CardGameState } from "../schema/CardGameState";
export class DeepSync extends Command<CardGameState> {
execute() {
this.state.i = 0;
return [new DeepOneSync(), new DeepOneSync()];
}
}
export class DeepOneSync extends Command<CardGameState> {
execute() {
this.state.i += 1;
return [new DeepTwoSync()];
}
}
export class DeepTwoSync extends Command<CardGameState> {
execute() {
this.state.i += 10;
return [new DeepThreeSync()];
}
}
export class DeepThreeSync extends Command<CardGameState> {
execute() {
this.state.i += 100;
}
}