Add phase-1 ability primitives and builder support

This commit is contained in:
Shard
2026-03-27 15:40:57 +00:00
parent a656c701c0
commit 9e4fbd12a7
7 changed files with 243 additions and 16 deletions
@@ -13,6 +13,7 @@ using SOR.Database.Enums;
[PolyType(typeof(AndCondition), "AND")]
[PolyType(typeof(OrCondition), "OR")]
[PolyType(typeof(XorCondition), "XOR")]
[PolyType(typeof(NotCondition), "NOT")]
// Unit (§6.1)
[PolyType(typeof(HealthBelowCondition), "HealthBelow")]
[PolyType(typeof(HealthAboveCondition), "HealthAbove")]
@@ -23,6 +24,9 @@ using SOR.Database.Enums;
[PolyType(typeof(IsAdjacentToCondition), "IsAdjacentTo")]
[PolyType(typeof(WithinRangeOfCondition), "WithinRangeOf")]
[PolyType(typeof(MovementTypeIsCondition), "MovementTypeIs")]
[PolyType(typeof(DestinationTileAffinityIsCondition), "DestinationTileAffinityIs")]
[PolyType(typeof(PreviousTileAffinityIsCondition), "PreviousTileAffinityIs")]
[PolyType(typeof(MovedFromOrIntoAffinityCondition), "MovedFromOrIntoAffinity")]
// Player (§6.2)
[PolyType(typeof(SPAtLeastCondition), "SPAtLeast")]
[PolyType(typeof(SPAtMostCondition), "SPAtMost")]
@@ -59,6 +63,7 @@ public abstract class Condition
public sealed class AndCondition : Condition { public Condition[] Conditions { get; set; } = []; }
public sealed class OrCondition : Condition { public Condition[] Conditions { get; set; } = []; }
public sealed class XorCondition : Condition { public Condition[] Conditions { get; set; } = []; }
public sealed class NotCondition : Condition { public Condition Condition { get; set; } = new IsOwnTurnCondition(); }
// ── Unit conditions (§6.1) ────────────────────────────────────────────────────
@@ -85,6 +90,9 @@ public sealed class WithinRangeOfCondition : Condition
}
public sealed class MovementTypeIsCondition : Condition { public MovementType MovementType { get; set; } }
public sealed class DestinationTileAffinityIsCondition : Condition { public Affinity Affinity { get; set; } }
public sealed class PreviousTileAffinityIsCondition : Condition { public Affinity Affinity { get; set; } }
public sealed class MovedFromOrIntoAffinityCondition : Condition { public Affinity Affinity { get; set; } }
// ── Player conditions (§6.2) ──────────────────────────────────────────────────