using System.Collections.ObjectModel; namespace NeonSprawl.Server.Game.Npc; /// In-memory NPC behavior catalog loaded at startup (NEO-88). Game callers should use . public sealed class NpcBehaviorDefinitionCatalog( string npcBehaviorsDirectory, IReadOnlyDictionary byId, int catalogJsonFileCount) { /// Absolute path to the directory that was enumerated for *_npc_behaviors.json catalogs. public string NpcBehaviorsDirectory { get; } = npcBehaviorsDirectory; public IReadOnlyDictionary ById { get; } = new ReadOnlyDictionary(new Dictionary(byId, StringComparer.Ordinal)); public int DistinctBehaviorCount => ById.Count; /// Number of *_npc_behaviors.json files under . public int CatalogJsonFileCount { get; } = catalogJsonFileCount; /// Resolves a catalog row by stable behavior . public bool TryGetBehavior(string id, out NpcBehaviorDefRow? row) => ById.TryGetValue(id, out row); }