24 lines
1.4 KiB
C#
24 lines
1.4 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace NeonSprawl.Server.Game.Quests;
|
|
|
|
/// <summary>
|
|
/// Read-only access to validated <see cref="QuestDefRow"/> entries loaded at startup (<see cref="QuestDefinitionCatalog"/>).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para><b>E7.M1 (quest accept / progress / objective advance):</b> callers validating quest ids and resolving quest metadata should depend on this interface
|
|
/// rather than <see cref="QuestDefinitionCatalog"/> so quest defs stay centralized.</para>
|
|
/// <para><b>NEO-115:</b> HTTP/read-model projections should depend on this interface rather than reaching into the catalog.</para>
|
|
/// </remarks>
|
|
public interface IQuestDefinitionRegistry
|
|
{
|
|
/// <summary>Attempts to resolve a quest by stable <c>id</c> (see <c>quest-def.schema.json</c>). Unknown ids and <c>null</c> return <c>false</c> without throwing.</summary>
|
|
bool TryGetDefinition(string? questId, [NotNullWhen(true)] out QuestDefRow? definition);
|
|
|
|
/// <summary>Trims and lowercases <paramref name="rawQuestId"/>; 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? rawQuestId, [NotNullWhen(true)] out string normalized);
|
|
|
|
/// <summary>Every loaded definition, ordered by <see cref="QuestDefRow.Id"/> (ordinal).</summary>
|
|
IReadOnlyList<QuestDefRow> GetDefinitionsInIdOrder();
|
|
}
|