namespace SOR.Game.Abilities.Models;
/// How long an applied effect persists.
public enum DurationType
{
/// One-time change; no ongoing tracking required.
Instant,
/// Expires at the end of the current active player's turn.
UntilEndOfTurn,
/// Expires at the start of the ability-owner's next turn.
UntilStartOfOwnerTurn,
/// Expires at the start of the source unit's owner's next turn.
UntilStartOfSourceOwnerTurn,
/// Expires after exactly N turns have elapsed.
ForNTurns,
/// Active while a condition evaluates to true; expires when it becomes false.
WhileCondition,
/// Active while the ability's source unit is on the battlefield; revoked on leave/death.
WhileSourceOnBattlefield,
/// Persists for the entire match; never expires.
PermanentInMatch,
}
///
/// Duration descriptor attached to every Action in the ability model.
/// Governs how long the action's effects remain active.
///
public sealed class DurationModel
{
public DurationType Type { get; set; } = DurationType.Instant;
/// Turn count for .
public int? N { get; set; }
/// Condition evaluated each turn for .
public Condition? Condition { get; set; }
///
/// Optional ownership scope for timing anchors.
/// E.g., "Owner" scopes "UntilEndOfTurn" to the ability-owner's turn end specifically.
///
public string? PlayerScope { get; set; }
public static DurationModel Instant => new() { Type = DurationType.Instant };
public static DurationModel Permanent => new() { Type = DurationType.PermanentInMatch };
public static DurationModel EndOfTurn => new() { Type = DurationType.UntilEndOfTurn };
}