Commit Graph

2 Commits

Author SHA1 Message Date
SepComet 853886797c refactor 2: 迁移局内资源真值
- CombatInRunResourceManager 现在持有并管理:
    - CurrentCoin
    - CurrentBaseHp
    - MaxBaseHp
    - GainedCoin / GainedGold
    - 本局 BuildTowerStats 快照
    - 奖励背包快照
    - CombatInRunResourceManager.cs:38
    - CombatInRunResourceManager.cs:46
    - CombatInRunResourceManager.cs:89
    - CombatInRunResourceManager.cs:156
- CombatScheduler 变成资源访问入口,不再通过 CombatNodeComponent 持有 coin/baseHp/build stats 真值。
    - 启动时先初始化局内资源。
    - 对外提供 CurrentCoin / CurrentGold / CurrentBaseHp / CurrentBuildTowerCount
    - 提供 TryConsumeCoin / AddCoin / TryGetBuildTowerStats
- CombatNodeComponent 已退回 facade:
    - 不再保存 _currentCoin / _currentGold / _currentBaseHp / _currentBuildTowerStats
    - 只做只读转发和启动/结束协调
- 资源变化事件现在由资源管理器发布,并补上了 delta 字段:

额外修正
- Reset() 现在会清掉奖励背包里的 ParticipantTowerInstanceIds,避免跨局残留。
- TryConsumeCoin(0) 保持原先返回 true 的语义。
2026-03-07 11:41:47 +08:00
SepComet 1d7c5b80d9 refactor 1: 新增/重命名类定义
- 将资源服务类型从 CombatResourceManager 重命名为 CombatInRunResourceManager,并同步更新现有引用。
    - CombatScheduler.cs:28
    - CombatInRunResourceManager.cs:11
    - CombatFinishFormState.cs:22
- 新增掉落解析骨架:
    - EnemyDropResolveContext.cs:6
    - EnemyDropResolveResult.cs:3
    - EnemyDropResolver.cs:7
- 新增 phase end condition 骨架:
    - IPhaseEndCondition.cs:5
    - PhaseEndConditionContext.cs:5
    - PhaseEndConditionFactory.cs:5
    - 以及 4 个实现类:
        - NonePhaseEndCondition
        - TimeElapsedPhaseEndCondition
        - EnemiesClearedPhaseEndCondition
        - BossDeadPhaseEndCondition
2026-03-07 11:30:44 +08:00