feat(game): 添加开会暂停系统——点击开会按钮暂停游戏,可安心发激励,结束开会后恢复
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user