using System.Collections.ObjectModel;
namespace NeonSprawl.Server.Game.Encounters;
/// In-memory encounter catalog loaded at startup (NEO-101). Game callers should use (NEO-102).
public sealed class EncounterDefinitionCatalog(
string encountersDirectory,
IReadOnlyDictionary byId,
int catalogJsonFileCount)
{
/// Absolute path to the directory that was enumerated for *_encounters.json catalogs.
public string EncountersDirectory { get; } = encountersDirectory;
public IReadOnlyDictionary ById { get; } =
new ReadOnlyDictionary(new Dictionary(byId, StringComparer.Ordinal));
public int DistinctEncounterCount => ById.Count;
/// Number of *_encounters.json files under .
public int CatalogJsonFileCount { get; } = catalogJsonFileCount;
/// Resolves a catalog row by stable encounter .
public bool TryGetEncounter(string id, out EncounterDefRow? row) =>
ById.TryGetValue(id, out row);
}