namespace PkmnLib.Dynamic.Models;

/// <summary>
/// The result of a battle.
/// </summary>
public record struct BattleResult
{
    private BattleResult(bool conclusiveResult, byte? winningSide)
    {
        ConclusiveResult = conclusiveResult;
        WinningSide = winningSide;
    }

    /// <summary>
    /// An inconclusive battle result. This means no side has won.
    /// </summary>
    public static BattleResult Inconclusive => new(false, null);

    /// <summary>
    /// A conclusive battle result. This means one side has won.
    /// </summary>
    public static BattleResult Conclusive(byte winningSide) => new(true, winningSide);

    /// <summary>
    /// Whether the battle has a conclusive result. If false, no side has won.
    /// </summary>
    public bool ConclusiveResult { get; }

    /// <summary>
    /// The side that won the battle. If null, no side has won.
    /// </summary>
    public byte? WinningSide { get; }
}