neon-sprawl/server/NeonSprawl.Server/Game/Mastery/MasteryCatalog.cs

30 lines
1.3 KiB
C#

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