neon-sprawl/server/NeonSprawl.Server/Game/Skills/SkillDefinitionCatalog.cs

22 lines
983 B
C#

using System.Collections.ObjectModel;
namespace NeonSprawl.Server.Game.Skills;
/// <summary>In-memory skill catalog loaded at startup (NEO-34). Game code should prefer <see cref="ISkillDefinitionRegistry"/> for lookups (NEO-35).</summary>
public sealed class SkillDefinitionCatalog(
string skillsDirectory,
IReadOnlyDictionary<string, SkillDefRow> byId,
int catalogJsonFileCount)
{
/// <summary>Absolute path to the directory that was enumerated for <c>*_skills.json</c> catalogs.</summary>
public string SkillsDirectory { get; } = skillsDirectory;
public IReadOnlyDictionary<string, SkillDefRow> ById { get; } =
new ReadOnlyDictionary<string, SkillDefRow>(new Dictionary<string, SkillDefRow>(byId, StringComparer.Ordinal));
public int DistinctSkillCount => ById.Count;
/// <summary>Number of <c>*_skills.json</c> files under <see cref="SkillsDirectory"/>.</summary>
public int CatalogJsonFileCount { get; } = catalogJsonFileCount;
}