namespace SVSim.Database.Enums;
///
/// Rank-tier bucket names used by mission/achievement catalog rows keyed as
/// rank_achieved:{tier}. Boundaries pinned from ranks.csv:
///
/// - 1-4 = Beginner 0-3
/// - 5-8 = D0-D3
/// - 9-12 = C0-C3
/// - 13-16 = B0-B3
/// - 17-20 = A0-A3
/// - 21-24 = AA0-AA3
/// - 25 = Master
/// - 26-29 = Grand Master (G026-G029)
///
/// The current prod catalog has no rank_achieved:grand_master rows, but the
/// emit is still faithful — a grand-master promotion advances the top-level
/// rank_achieved counter and the tier-qualified one (which no catalog row
/// reads yet, but stays consistent if one lands later).
///
public static class RankTier
{
/// Wire rank_id → catalog-facing tier name. Null iff is out of range.
public static string? Name(int rankId) => rankId switch
{
>= 1 and <= 4 => "beginner",
>= 5 and <= 8 => "d",
>= 9 and <= 12 => "c",
>= 13 and <= 16 => "b",
>= 17 and <= 20 => "a",
>= 21 and <= 24 => "aa",
25 => "master",
>= 26 and <= 29 => "grand_master",
_ => null,
};
}