修改重置游戏状态的方法
This commit is contained in:
parent
bd7c8dfae5
commit
5f37ab604e
@ -7,6 +7,8 @@ import {singleton} from "../../common/Singleton";
|
||||
import {GameEnv} from "../../cfg/GameEnv";
|
||||
import {debugRoom, error} from "../../common/Debug";
|
||||
import gameUtil from "../../utils/game.util";
|
||||
import {Card} from "../schema/Card";
|
||||
import {MapSchema, SetSchema} from "@colyseus/schema";
|
||||
|
||||
/**
|
||||
* 游戏结束
|
||||
@ -108,10 +110,13 @@ export class GameResultCommand extends Command<CardGameState, {}> {
|
||||
this.state.round = 0;
|
||||
this.state.cardQueue.length = 0;
|
||||
this.state.cards.clear();
|
||||
this.state.cards = new MapSchema<Card>();
|
||||
|
||||
for (let [,player] of this.state.players) {
|
||||
player.cards.clear();
|
||||
player.cards = new MapSchema<Card>()
|
||||
player.cardSet.clear();
|
||||
player.cardSet = new SetSchema<string>();
|
||||
player.countTotal = 0;
|
||||
player.countPresent = 0;
|
||||
for(let [,pet] of player.pets) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user