删除无用代码
This commit is contained in:
parent
7f59ffe0a5
commit
10cb2a1362
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user