feat(battle-node): typed MatchedBody + Self/Oppo info records
This commit is contained in:
36
SVSim.BattleNode/Protocol/Bodies/MatchedBody.cs
Normal file
36
SVSim.BattleNode/Protocol/Bodies/MatchedBody.cs
Normal 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);
|
||||
Reference in New Issue
Block a user