refactor(battle-node): address final-review minor notes (comments + test backfill)
- PlayActionsHandler doc: drop the phantom 'with a debug log' (handlers are stateless singletons with no logger); say token plays degrade silently. - KnownListBuilder.ExtractMoveTo doc: note first-match-wins semantics and the send-side==recv-side 'to' assumption pending recv-capture confirmation. - KnownListBuilderTests: add multi-move first-match coverage and the in-deck-but-no-matching-move null branch for BuildPlayedCard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,8 @@ namespace SVSim.BattleNode.Sessions.Dispatch.Handlers;
|
||||
|
||||
/// <summary>PvP PlayActions translator (vanilla deck-card slice). Synthesizes the opponent-facing
|
||||
/// knownList from the sender's idx->cardId map + the orderList move op, renames targetList ->
|
||||
/// oppoTargetList, drops orderList, consumes keyAction. Token plays (idx>deck) degrade to
|
||||
/// {playIdx,type} with a debug log. Scripted/Bot drop (no rule).</summary>
|
||||
/// oppoTargetList, drops orderList, consumes keyAction. Token plays (idx>deck) degrade silently to
|
||||
/// {playIdx,type} (no knownList). Scripted/Bot drop (no rule).</summary>
|
||||
internal sealed class PlayActionsHandler : IFrameHandler
|
||||
{
|
||||
public IReadOnlyList<DispatchRoute> Handle(FrameDispatchContext ctx)
|
||||
|
||||
@@ -20,8 +20,11 @@ internal static class KnownListBuilder
|
||||
return new KnownCardEntry(Idx: playIdx, CardId: cardId, To: to.Value, Spellboost: 0, AttachTarget: "");
|
||||
}
|
||||
|
||||
/// <summary>The <c>to</c> place-state of the <c>move</c> op whose <c>idx</c> list contains
|
||||
/// <paramref name="playIdx"/>, or null if absent.</summary>
|
||||
/// <summary>The <c>to</c> place-state of the FIRST <c>move</c> op whose <c>idx</c> list contains
|
||||
/// <paramref name="playIdx"/> (the played card's own move; later add/alter ops are the deferred
|
||||
/// token slice), or null if absent. NOTE: the sender-side <c>to</c> is passed through verbatim —
|
||||
/// for the vanilla slice we assume send-side and recv-side place-state codes match, pending
|
||||
/// recv-capture confirmation.</summary>
|
||||
public static int? ExtractMoveTo(object? orderList, int playIdx)
|
||||
{
|
||||
if (orderList is not IEnumerable<object?> ops) return null;
|
||||
|
||||
Reference in New Issue
Block a user