using System.Diagnostics.CodeAnalysis;

namespace NeonSprawl.Server.Game.Mastery;

/// <summary>
/// Read-only access to validated mastery tracks and perks loaded at startup (<see cref="MasteryCatalog"/>).
/// </summary>
public interface IMasteryCatalogRegistry
{
    /// <summary>Attempts to resolve a track by <c>skillId</c>. Unknown ids and <c>null</c> return <c>false</c> without throwing.</summary>
    bool TryGetTrack(string? skillId, [NotNullWhen(true)] out MasteryTrackRow? track);

    /// <summary>Attempts to resolve a perk by stable <c>id</c>. Unknown ids and <c>null</c> return <c>false</c> without throwing.</summary>
    bool TryGetPerk(string? perkId, [NotNullWhen(true)] out PerkDefRow? perk);

    /// <summary>Every loaded track, ordered by <see cref="MasteryTrackRow.SkillId"/> (ordinal).</summary>
    IReadOnlyList<MasteryTrackRow> GetTracksInSkillIdOrder();

    /// <summary>Every loaded perk, ordered by <see cref="PerkDefRow.Id"/> (ordinal).</summary>
    IReadOnlyList<PerkDefRow> GetPerksInIdOrder();
}
