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
|
public sealed class WinConditions
|
||||||
{
|
{
|
||||||
@ -42,34 +40,25 @@ public sealed class WinConditions
|
|||||||
|
|
||||||
public bool GameTimer { get; set; }
|
public bool GameTimer { get; set; }
|
||||||
|
|
||||||
public override string ToString()
|
public IEnumerable<string> Enumerate()
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
|
||||||
|
|
||||||
if (Annihilate)
|
if (Annihilate)
|
||||||
sb.Append("Annihilate ");
|
yield return nameof(Annihilate);
|
||||||
|
if (Assassinate)
|
||||||
if (Assassinate)
|
yield return nameof(Assassinate);
|
||||||
sb.Append(nameof(Assassinate) + ' ');
|
|
||||||
|
|
||||||
if (ControlArea)
|
if (ControlArea)
|
||||||
sb.Append("ControlArea ");
|
yield return nameof(ControlArea);
|
||||||
|
|
||||||
if (DestroyHQ)
|
if (DestroyHQ)
|
||||||
sb.Append("DestroyHQ ");
|
yield return nameof(DestroyHQ);
|
||||||
|
|
||||||
if (EconomicVictory)
|
if (EconomicVictory)
|
||||||
sb.Append("EconomicVictory ");
|
yield return nameof(EconomicVictory);
|
||||||
|
|
||||||
if (GameTimer)
|
if (GameTimer)
|
||||||
sb.Append("GameTimer ");
|
yield return nameof(GameTimer);
|
||||||
|
|
||||||
if (SuddenDeath)
|
if (SuddenDeath)
|
||||||
sb.Append("SuddenDeath ");
|
yield return nameof(SuddenDeath);
|
||||||
|
|
||||||
if (TakeAndHold)
|
if (TakeAndHold)
|
||||||
sb.Append("TakeAndHold ");
|
yield return nameof(TakeAndHold);
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString() => string.Join('\n', Enumerate());
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user