refactor: misc

This commit is contained in:
2026-04-04 16:34:17 +08:00
parent 72e159e52b
commit 76687de672
3 changed files with 13 additions and 24 deletions
+3 -4
View File
@@ -1,5 +1,4 @@
import Phaser from 'phaser';
import type { BoopState, PlayerType, PieceType } from '@/game/boop';
import type { BoopState } from '@/game/boop';
import { GameHostScene } from 'boardgame-phaser';
import { commands } from '@/game/boop';
import { BoardRenderer } from './BoardRenderer';
@@ -36,7 +35,7 @@ export class GameScene extends GameHostScene<BoopState> {
});
// 监听状态变化
this.watch(() => {
this.addEffect(() => {
const winner = this.state.winner;
if (winner) {
this.winnerOverlay.show(winner);
@@ -45,7 +44,7 @@ export class GameScene extends GameHostScene<BoopState> {
}
});
this.watch(() => {
this.addEffect(() => {
const currentPlayer = this.state.currentPlayer;
this.boardRenderer.updateTurnText(currentPlayer, this.state);
this.supplyUI.update(this.state);