24 lines
1.5 KiB
C#
24 lines
1.5 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace NeonSprawl.Server.Game.Encounters;
|
|
|
|
/// <summary>
|
|
/// Read-only access to validated <see cref="EncounterDefRow"/> entries loaded at startup (<see cref="EncounterDefinitionCatalog"/>).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para><b>E5.M3 (encounter progress / completion):</b> callers validating encounter ids and resolving completion metadata should depend on this interface
|
|
/// rather than <see cref="EncounterDefinitionCatalog"/> so encounter defs stay centralized.</para>
|
|
/// <para><b>NEO-103:</b> HTTP/read-model projections should depend on this interface rather than reaching into the catalog.</para>
|
|
/// </remarks>
|
|
public interface IEncounterDefinitionRegistry
|
|
{
|
|
/// <summary>Attempts to resolve an encounter by stable <c>id</c> (see <c>encounter-def.schema.json</c>). Unknown ids and <c>null</c> return <c>false</c> without throwing.</summary>
|
|
bool TryGetDefinition(string? encounterId, [NotNullWhen(true)] out EncounterDefRow? definition);
|
|
|
|
/// <summary>Trims and lowercases <paramref name="rawEncounterId"/>; returns <c>true</c> when the normalized id exists in the loaded catalog. <c>null</c>, empty, and whitespace return <c>false</c> without throwing.</summary>
|
|
bool TryNormalizeKnown(string? rawEncounterId, [NotNullWhen(true)] out string normalized);
|
|
|
|
/// <summary>Every loaded definition, ordered by <see cref="EncounterDefRow.Id"/> (ordinal).</summary>
|
|
IReadOnlyList<EncounterDefRow> GetDefinitionsInIdOrder();
|
|
}
|