refactor 6:
- CombatInfoFormUseCase.cs 改成回调驱动:
- 不再直接读 GameEntry.CombatNode
- 由 CombatLoadSession.cs 在打开 CombatInfoForm 前注入 modelProvider 和 TryEndCombat 回调
- CombatSelectFormUseCase.cs 的默认 coin provider 改成返回 0,不再偷偷 fallback 到 GameEntry.CombatNode
- CombatFinishFormUseCase.cs 去掉了未准备 summary 时对 GameEntry.CombatNode 的兜底读取
- MapData.cs 进一步补充了战斗初始快照:
- InventorySnapshot
- ParticipantTowerSnapshot
- CombatLoadingState.cs 现在会把这些背包/参战塔快照也一起打进 MapData
- MapEntity.cs 配置建塔面板时不再直接读 PlayerInventory,改为用 MapData 里的快照
This commit is contained in:
@@ -243,12 +243,6 @@ namespace GeometryTD.Entity
|
||||
private void ConfigureCombatSelectUseCase()
|
||||
{
|
||||
_combatSelectFormUseCase.SetCoinProvider(GetCurrentCoin);
|
||||
BackpackInventoryData inventorySnapshot = GameEntry.PlayerInventory != null
|
||||
? GameEntry.PlayerInventory.GetInventorySnapshot()
|
||||
: null;
|
||||
IReadOnlyList<TowerItemData> participantTowers = GameEntry.PlayerInventory != null
|
||||
? GameEntry.PlayerInventory.GetParticipantTowerSnapshot()
|
||||
: null;
|
||||
_combatSelectUseCaseConfigurator?.Configure(
|
||||
_combatSelectFormUseCase,
|
||||
GetCurrentCoin,
|
||||
@@ -259,8 +253,8 @@ namespace GeometryTD.Entity
|
||||
_destroyGain,
|
||||
_buildTowerCosts,
|
||||
GetCurrentBuildTowerCount(),
|
||||
inventorySnapshot,
|
||||
participantTowers);
|
||||
_mapData != null ? _mapData.InventorySnapshot : null,
|
||||
_mapData != null ? _mapData.ParticipantTowerSnapshot : null);
|
||||
}
|
||||
|
||||
private void HandleCombatSelectInput()
|
||||
|
||||
Reference in New Issue
Block a user