Win conditions fix
This commit is contained in:
parent
c575ddf844
commit
539a3d3d68
@ -1,6 +1,4 @@
|
||||
using System.Text;
|
||||
|
||||
namespace SoulstormReplayReader.Core.Domain;
|
||||
namespace SoulstormReplayReader.Core.Domain;
|
||||
|
||||
public sealed class WinConditions
|
||||
{
|
||||
@ -42,34 +40,25 @@ public sealed class WinConditions
|
||||
|
||||
public bool GameTimer { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
public IEnumerable<string> Enumerate()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if (Annihilate)
|
||||
sb.Append("Annihilate ");
|
||||
|
||||
if (Assassinate)
|
||||
sb.Append(nameof(Assassinate) + ' ');
|
||||
|
||||
yield return nameof(Annihilate);
|
||||
if (Assassinate)
|
||||
yield return nameof(Assassinate);
|
||||
if (ControlArea)
|
||||
sb.Append("ControlArea ");
|
||||
|
||||
yield return nameof(ControlArea);
|
||||
if (DestroyHQ)
|
||||
sb.Append("DestroyHQ ");
|
||||
|
||||
yield return nameof(DestroyHQ);
|
||||
if (EconomicVictory)
|
||||
sb.Append("EconomicVictory ");
|
||||
|
||||
yield return nameof(EconomicVictory);
|
||||
if (GameTimer)
|
||||
sb.Append("GameTimer ");
|
||||
|
||||
yield return nameof(GameTimer);
|
||||
if (SuddenDeath)
|
||||
sb.Append("SuddenDeath ");
|
||||
|
||||
yield return nameof(SuddenDeath);
|
||||
if (TakeAndHold)
|
||||
sb.Append("TakeAndHold ");
|
||||
|
||||
return sb.ToString();
|
||||
yield return nameof(TakeAndHold);
|
||||
}
|
||||
|
||||
public override string ToString() => string.Join('\n', Enumerate());
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user