using System.Collections.ObjectModel; namespace NeonSprawl.Server.Game.Mastery; /// In-memory mastery catalog loaded at startup (NEO-46). Prefer for lookups. public sealed class MasteryCatalog { public MasteryCatalog( string masteryDirectory, IReadOnlyDictionary tracksBySkillId, IReadOnlyDictionary perksById, int catalogJsonFileCount) { MasteryDirectory = masteryDirectory; TracksBySkillId = new ReadOnlyDictionary( new Dictionary(tracksBySkillId, StringComparer.Ordinal)); PerksById = new ReadOnlyDictionary( new Dictionary(perksById, StringComparer.Ordinal)); CatalogJsonFileCount = catalogJsonFileCount; } /// Absolute path to the directory enumerated for *_mastery.json catalogs. public string MasteryDirectory { get; } public IReadOnlyDictionary TracksBySkillId { get; } public IReadOnlyDictionary PerksById { get; } public int TrackCount => TracksBySkillId.Count; public int PerkCount => PerksById.Count; /// Number of *_mastery.json files under . public int CatalogJsonFileCount { get; } }