26 lines
668 B
C#
26 lines
668 B
C#
using GeometryTD.Definition;
|
|
|
|
namespace GeometryTD.CustomComponent
|
|
{
|
|
internal sealed class NonePhaseEndCondition : IPhaseEndCondition
|
|
{
|
|
public PhaseEndType EndType => PhaseEndType.None;
|
|
|
|
public bool ShouldExit(in PhaseEndConditionContext context)
|
|
{
|
|
if (context.Phase == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (context.Phase.DurationSeconds > 0 &&
|
|
context.PhaseElapsedSeconds >= context.Phase.DurationSeconds)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return context.IsPhaseSpawnCompleted && context.AliveEnemyCount <= 0;
|
|
}
|
|
}
|
|
}
|