37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
namespace GeometryTD.CustomComponent
|
|
{
|
|
internal sealed class CombatRewardSelectionState : CombatStateBase
|
|
{
|
|
public CombatRewardSelectionState(CombatSchedulerRuntime runtime, CombatSchedulerCoordinator coordinator)
|
|
: base(runtime, coordinator)
|
|
{
|
|
}
|
|
|
|
public override void OnEnter()
|
|
{
|
|
if (Runtime.SettlementContext == null)
|
|
{
|
|
Coordinator.EnterFailureFallback("Combat reward selection failed. Settlement context is missing.");
|
|
return;
|
|
}
|
|
|
|
Coordinator.EnsureRewardSelectFormUseCaseBound();
|
|
if (!Runtime.CombatSettlementService.TryPrepareRewardSelection(
|
|
Runtime.SettlementContext,
|
|
Runtime.PhaseLoopRuntime.DisplayPhaseIndex,
|
|
Coordinator.ResolveCurrentThemeType(),
|
|
Runtime.RewardSelectFormUseCase,
|
|
Coordinator.OnFullBaseHpRewardSelected,
|
|
Coordinator.OnFullBaseHpRewardGiveUp))
|
|
{
|
|
Coordinator.ChangeState(new CombatFinishFormState(Runtime, Coordinator));
|
|
}
|
|
}
|
|
|
|
public override void OnExit()
|
|
{
|
|
Coordinator.CloseRewardSelectForm();
|
|
}
|
|
}
|
|
}
|