Files
SVSimServer/SVSim.BattleNode/Protocol/KeyActionType.cs
gamer147 e70f32db79 refactor(battlenode): close §A boolean-blindness items (MinedToken, Stock, KeyActionType)
Behavior-preserving; 231 BattleNode tests green.

- MinedToken record struct replaces the transpose-prone (int Idx, long CardId,
  CardOwner IsSelf) tuple returned by KnownListBuilder.Mine*. Positional deconstruct
  keeps the Record*From call sites unchanged.
- enum Stock { Normal, Bypass } replaces the negative `bool noStock` on
  IBattleParticipant.PushAsync and DispatchRoute, threaded through both participants,
  BattleSession, and all handler construction sites.
- enum KeyActionType mirrors the client's SendKeyActionDataManager.KeyActionType;
  the StripKeyActionForOpponent guard compares named values, KeyActionEntry.Type is
  the enum (wire-identical via JsonNumberEnumConverter).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 22:53:32 -04:00

24 lines
942 B
C#

namespace SVSim.BattleNode.Protocol;
/// <summary>
/// Wire value of <c>type</c> on a keyAction entry — what kind of card-generating choice the play
/// is. Mirrors the client's <c>SendKeyActionDataManager.KeyActionType</c> exactly (same ordinals);
/// the client reads it back via <c>ConvertToInt(...)</c>, so it serializes as the underlying int
/// via <see cref="System.Text.Json.Serialization.JsonNumberEnumConverter{T}"/>. The node currently
/// relays only <see cref="Choice"/> and <see cref="HaveBeforeSkillChoice"/>
/// (<see cref="Bodies.KeyActionEntry"/> / <c>KnownListBuilder.StripKeyActionForOpponent</c>); the
/// rest are defined so the guard compares against named values instead of bare ints.
/// </summary>
public enum KeyActionType
{
None = 0,
Choice = 1,
Accelerated = 2,
Crystallize = 3,
Fusion = 4,
HaveBeforeSkillChoice = 5,
BurialRate = 6,
ChoiceEvolution = 7,
ChoiceBrave = 8,
}