using System.Collections.ObjectModel; namespace NeonSprawl.Server.Game.Crafting; /// In-memory recipe catalog loaded at startup (NEO-66). Game callers should use (NEO-67). public sealed class RecipeDefinitionCatalog( string recipesDirectory, IReadOnlyDictionary byId, int catalogJsonFileCount) { /// Absolute path to the directory that was enumerated for *_recipes.json catalogs. public string RecipesDirectory { get; } = recipesDirectory; public IReadOnlyDictionary ById { get; } = new ReadOnlyDictionary(new Dictionary(byId, StringComparer.Ordinal)); public int DistinctRecipeCount => ById.Count; /// Number of *_recipes.json files under . public int CatalogJsonFileCount { get; } = catalogJsonFileCount; /// Resolves a catalog row by stable recipe (includes embedded I/O rows). public bool TryGetRecipe(string id, out RecipeDefRow? row) => ById.TryGetValue(id, out row); }