28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
using System.Collections.ObjectModel;
|
|
|
|
namespace NeonSprawl.Server.Game.Factions;
|
|
|
|
/// <summary>In-memory faction catalog loaded at startup (NEO-134). Game code should prefer <see cref="IFactionDefinitionRegistry"/> for lookups.</summary>
|
|
public sealed class FactionDefinitionCatalog
|
|
{
|
|
public FactionDefinitionCatalog(
|
|
string factionsDirectory,
|
|
IReadOnlyDictionary<string, FactionDefRow> byId,
|
|
int catalogJsonFileCount)
|
|
{
|
|
FactionsDirectory = factionsDirectory;
|
|
ById = new ReadOnlyDictionary<string, FactionDefRow>(new Dictionary<string, FactionDefRow>(byId, StringComparer.Ordinal));
|
|
CatalogJsonFileCount = catalogJsonFileCount;
|
|
}
|
|
|
|
/// <summary>Absolute path to the directory that was enumerated for <c>*_factions.json</c> catalogs.</summary>
|
|
public string FactionsDirectory { get; }
|
|
|
|
public IReadOnlyDictionary<string, FactionDefRow> ById { get; }
|
|
|
|
public int DistinctFactionCount => ById.Count;
|
|
|
|
/// <summary>Number of <c>*_factions.json</c> files under <see cref="FactionsDirectory"/>.</summary>
|
|
public int CatalogJsonFileCount { get; }
|
|
}
|