Files
SVSimServer/SVSim.EmulatedEntrypoint/Services/IArenaTwoPickService.cs
gamer147 94622a526d refactor(arena-tk2): FinishAsync returns RunFinishOutcome with WasFullClear signal
Introduces RunFinishOutcome — a semantic record that wraps the wire
FinishResponseDto with the controller-side WasFullClear signal used to fire
the challenge_full_clear mission event. The wire response isn't affected
(controller unwraps the .Response field before returning to the client);
RetireAsync stays returning FinishResponseDto because retire cannot full-clear.

Full-clear detection compares run.WinCount against ResolveMaxBattleCountAsync
rather than hard-coding 5, so a future TK2 rules-config change tracks
automatically. New test covers the full-clear signal explicitly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-04 13:17:23 -04:00

26 lines
1.1 KiB
C#

using SVSim.EmulatedEntrypoint.Models.Dtos.Responses.ArenaTwoPick;
namespace SVSim.EmulatedEntrypoint.Services;
public interface IArenaTwoPickService
{
Task<TopResponseDto> GetTopAsync(long viewerId);
Task<EntryResponseDto> EntryAsync(long viewerId, int consumeItemType);
Task<ClassChooseResponseDto> ChooseClassAsync(long viewerId, int classId);
Task<CardChooseResponseDto> ChooseCardAsync(long viewerId, long selectedId);
Task<FinishResponseDto> RetireAsync(long viewerId);
/// <summary>
/// Ends a completed TK2 run (5 battles played) and grants the reward tier for
/// <c>run.WinCount</c>. Returns both the wire-shape rewards and a controller-side
/// signal for mission emit (<see cref="RunFinishOutcome.WasFullClear"/>).
/// </summary>
Task<RunFinishOutcome> FinishAsync(long viewerId);
Task<BattleFinishResultDto> RecordBattleResultAsync(long viewerId, bool isWin);
}
public class ArenaTwoPickException : Exception
{
public string ErrorCode { get; }
public ArenaTwoPickException(string errorCode) : base(errorCode) { ErrorCode = errorCode; }
}