feat(battle-node): typed MatchedBody + Self/Oppo info records

This commit is contained in:
gamer147
2026-06-01 10:33:34 -04:00
parent 9217de3aa1
commit d9fbb67f0c
2 changed files with 135 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using System.Text.Json.Serialization;
namespace SVSim.BattleNode.Protocol.Bodies;
public sealed record MatchedBody(
[property: JsonPropertyName("selfInfo")] MatchedSelfInfo SelfInfo,
[property: JsonPropertyName("oppoInfo")] MatchedOppoInfo OppoInfo,
[property: JsonPropertyName("selfDeck")] IReadOnlyList<DeckCardRef> SelfDeck,
[property: JsonPropertyName("resultCode")] int ResultCode = 1) : IMsgBody;
public sealed record MatchedSelfInfo(
[property: JsonPropertyName("country_code")] string CountryCode,
[property: JsonPropertyName("userName")] string UserName,
[property: JsonPropertyName("sleeveId")] string SleeveId,
[property: JsonPropertyName("emblemId")] string EmblemId,
[property: JsonPropertyName("degreeId")] string DegreeId,
[property: JsonPropertyName("fieldId")] int FieldId,
[property: JsonPropertyName("isOfficial")] int IsOfficial,
[property: JsonPropertyName("oppoId")] long OppoId,
[property: JsonPropertyName("seed")] long Seed);
public sealed record MatchedOppoInfo(
[property: JsonPropertyName("country_code")] string CountryCode,
[property: JsonPropertyName("userName")] string UserName,
[property: JsonPropertyName("sleeveId")] string SleeveId,
[property: JsonPropertyName("emblemId")] string EmblemId,
[property: JsonPropertyName("degreeId")] string DegreeId,
[property: JsonPropertyName("fieldId")] int FieldId,
[property: JsonPropertyName("isOfficial")] int IsOfficial,
[property: JsonPropertyName("oppoId")] long OppoId,
[property: JsonPropertyName("seed")] long Seed,
[property: JsonPropertyName("oppoDeckCount")] int OppoDeckCount);
public sealed record DeckCardRef(
[property: JsonPropertyName("idx")] int Idx,
[property: JsonPropertyName("cardId")] long CardId);