neon-sprawl/server/NeonSprawl.Server/Game/Skills/ISkillDefinitionRegistry.cs

22 lines
1.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.Diagnostics.CodeAnalysis;
namespace NeonSprawl.Server.Game.Skills;
/// <summary>
/// Read-only access to validated <see cref="SkillDefRow"/> entries loaded at startup (<see cref="SkillDefinitionCatalog"/>).
/// </summary>
/// <remarks>
/// <para><b>E2.M2 (XP grants):</b> callers issuing skill XP must ensure <c>XpGrantEvent.sourceKind</c> (or successor)
/// is listed on the target skills <see cref="SkillDefRow.AllowedXpSourceKinds"/>; the award engine should reject
/// grants outside that set once implemented.</para>
/// <para><b>NEO-36:</b> HTTP/read-model projections should depend on this interface rather than reaching into the catalog.</para>
/// </remarks>
public interface ISkillDefinitionRegistry
{
/// <summary>Attempts to resolve a skill by stable <c>id</c> (see <c>skill-def.schema.json</c>). Unknown ids and <c>null</c> return <c>false</c> without throwing.</summary>
bool TryGetDefinition(string? skillId, [NotNullWhen(true)] out SkillDefRow? definition);
/// <summary>Every loaded definition, ordered by <see cref="SkillDefRow.Id"/> (ordinal).</summary>
IReadOnlyList<SkillDefRow> GetDefinitionsInIdOrder();
}