refactor 8:
- CombatScheduler 不再反向访问 GameEntry.CombatNode。现在由 CombatNodeComponent.cs:322 在初始化时把完成回调传进 scheduler,运行时回调保存在 CombatSchedulerRuntimeContext.cs:27,完成时由 CombatSchedulerFlowCoordinator.cs:245 触发;主题解析也只看当前战斗上下文,不再回退查 facade,见 CombatSchedulerFlowCoordinator.cs:161。同时把 MapEntity 的 coin 回调改成直接连到资源真值来源 CombatLoadingState.cs:56,并把 ICombatSchedulerHost 上那两个资源转发接口删掉,见 ICombatSchedulerHost.cs:5。 - 地图加载入口也收紧了。CombatLoadSession 现在要求必须有 MapEntityLoadContext.InitialMapData,不再走隐式兜底,见 CombatLoadSession.cs:227。EntityExtension 删除了 ShowMap(MapData) 旧重载,当前只保留 ShowMap(MapEntityLoadContext),见 EntityExtension.cs:52;MapEntity 也不再接受裸 MapData 的遗留分支,见 MapEntity.cs:263。
This commit is contained in:
+6
-7
@@ -60,13 +60,12 @@ namespace GeometryTD.CustomComponent
|
||||
position: Vector3.zero,
|
||||
initialCoin: Context.CombatInRunResourceManager.CurrentCoin,
|
||||
buildTowerStatsSnapshot: buildTowerStatsSnapshot,
|
||||
inventorySnapshot: GameEntry.PlayerInventory != null
|
||||
? GameEntry.PlayerInventory.GetInventorySnapshot()
|
||||
: null,
|
||||
participantTowerSnapshot: GameEntry.PlayerInventory != null
|
||||
? GameEntry.PlayerInventory.GetParticipantTowerSnapshot()
|
||||
: null);
|
||||
return new MapEntityLoadContext(mapData, Flow.TryConsumeCoin, Flow.AddCoin);
|
||||
inventorySnapshot: Context.CombatInRunResourceManager.GetCombatInventorySnapshot(),
|
||||
participantTowerSnapshot: Context.CombatInRunResourceManager.GetParticipantTowerSnapshot());
|
||||
return new MapEntityLoadContext(
|
||||
mapData,
|
||||
Context.CombatInRunResourceManager.TryConsumeCoin,
|
||||
Context.CombatInRunResourceManager.AddCoin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ namespace GeometryTD.CustomComponent
|
||||
Flow.EnsureRewardSelectFormUseCaseBound();
|
||||
if (!Context.SettlementFlowService.TryPrepareRewardSelection(
|
||||
Context.SettlementContext,
|
||||
Context.CombatInRunResourceManager,
|
||||
Context.EnemyDropResolver,
|
||||
Context.PhaseLoopRuntime.DisplayPhaseIndex,
|
||||
Flow.ResolveCurrentThemeType(),
|
||||
Context.RewardSelectFormUseCase,
|
||||
|
||||
Reference in New Issue
Block a user