feat(game): 添加开会暂停系统——点击开会按钮暂停游戏,可安心发激励,结束开会后恢复

This commit is contained in:
Cloud Bot
2026-03-24 09:13:14 +00:00
parent 6843d2b74c
commit b8ba572ffb
4 changed files with 157 additions and 33 deletions

View File

@@ -102,6 +102,22 @@ export class GameManager {
this.onKPIChange.forEach(cb => cb(this.kpi))
}
/** 暂停游戏(仅 playing 状态下有效) */
pause(): boolean {
if (this.gameState !== 'playing') return false
this.gameState = 'paused'
return true
}
/** 恢复游戏(仅 paused 状态下有效) */
resume(): boolean {
if (this.gameState !== 'paused') return false
this.gameState = 'playing'
return true
}
get isPaused(): boolean { return this.gameState === 'paused' }
/** 触发胜利 */
triggerVictory(): void {
if (this.gameState === 'playing') {