feat(battle-node): typed PlayActionsBroadcastBody + KnownCardEntry/OppoTargetEntry
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
30
SVSim.BattleNode/Protocol/Bodies/PlayActionsBroadcastBody.cs
Normal file
30
SVSim.BattleNode/Protocol/Bodies/PlayActionsBroadcastBody.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.BattleNode.Protocol.Bodies;
|
||||
|
||||
/// <summary>Opponent-facing PlayActions frame the node synthesizes from the active player's
|
||||
/// send. <c>KnownList</c> reveals the played card's identity (null = token reveal deferred, see
|
||||
/// the deterministic-turn slice). <c>OppoTargetList</c> is the renamed <c>targetList</c>
|
||||
/// (independent of KnownList — a targeted hand play carries both). Both omitted when null via the
|
||||
/// envelope's WhenWritingNull policy.</summary>
|
||||
public sealed record PlayActionsBroadcastBody(
|
||||
[property: JsonPropertyName("playIdx")] int PlayIdx,
|
||||
[property: JsonPropertyName("type")] int Type,
|
||||
[property: JsonPropertyName("knownList")] IReadOnlyList<KnownCardEntry>? KnownList,
|
||||
[property: JsonPropertyName("oppoTargetList")] IReadOnlyList<OppoTargetEntry>? OppoTargetList) : IMsgBody;
|
||||
|
||||
/// <summary>One revealed card in a <c>knownList</c>. Vanilla slice fills cardId from the sender's
|
||||
/// deck map and leaves spellboost 0 / attachTarget "" (cost/clan/tribe deferred to the card-master
|
||||
/// port — the receiver re-derives them from cardId).</summary>
|
||||
public sealed record KnownCardEntry(
|
||||
[property: JsonPropertyName("idx")] int Idx,
|
||||
[property: JsonPropertyName("cardId")] long CardId,
|
||||
[property: JsonPropertyName("to")] int To,
|
||||
[property: JsonPropertyName("spellboost")] int Spellboost,
|
||||
[property: JsonPropertyName("attachTarget")] string AttachTarget);
|
||||
|
||||
/// <summary>Renamed <c>targetList</c> entry. <c>isSelf</c> is actor-relative and passes through
|
||||
/// verbatim — no perspective flip (bullet-3 audit F2).</summary>
|
||||
public sealed record OppoTargetEntry(
|
||||
[property: JsonPropertyName("targetIdx")] int TargetIdx,
|
||||
[property: JsonPropertyName("isSelf")] int IsSelf);
|
||||
Reference in New Issue
Block a user