feat: add runtime gameInfo enrichment with gameOver condition
- Add gameOverCondition to GameManager for runtime tracking - Create enrichGameInfo() function to merge runtime condition with static gameInfo - Add formatGameOverCondition() utility to stringify boolean/function conditions - Returns enriched info with: - condition: formatted string representation - type: 'none' | 'static' | 'function' - Platform can call enrichGameInfo(gameManager) to get complete game configuration - Handles all condition types: undefined, boolean, function - Truncates long function strings at 200 chars
This commit is contained in:
@@ -29,4 +29,5 @@ export type GameManager = {
|
||||
hero: HeroManager;
|
||||
renderer: HeroRenderManager;
|
||||
scoreManager: ScoreManager;
|
||||
gameOverCondition?: boolean | ((scoreManager: ScoreManager) => boolean);
|
||||
} & GameStatusManager & GameKeyManager;
|
||||
|
||||
Reference in New Issue
Block a user