增加一些游戏生命周期方法的调用

This commit is contained in:
zhl 2020-12-24 16:38:07 +08:00
parent 0cf8dd8284
commit 2ffbe2ee8a
2 changed files with 2 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import {NextTurnCommand} from "./NextTurnCommand";
export class BeginGameCommand extends Command<CardGameState, {}> { export class BeginGameCommand extends Command<CardGameState, {}> {
async execute() { async execute() {
this.room.battleMan.onGameStart();
this.state.maxCardId = 0; this.state.maxCardId = 0;
let card0 = gameUtil.initCardQue(); let card0 = gameUtil.initCardQue();
let card1 = gameUtil.initCardQue(); let card1 = gameUtil.initCardQue();

View File

@ -122,6 +122,7 @@ export class GameResultCommand extends Command<CardGameState, {}> {
this.resetPet(pet); this.resetPet(pet);
} }
} }
this.room.battleMan.onGameEnd();
} }
resetPet(pet: Pet) { resetPet(pet: Pet) {
pet.state = 0; pet.state = 0;