refactor(battlenode): type MatchContext.ClassId as CardClass enum (§C)
Behavior-preserving; full solution builds, 1013 tests green. ClassId is the one genuinely-closed set of the three flagged stringly fields, so it becomes a CardClass enum (1..8). Wire stays "1".."8": producer casts (CardClass)run.ClassId, ServerBattleFrames renders via CardClassWire.ToWireValue(). RankBattleController's AI-start path drops a fragile int.TryParse(...)?:-1 for (int)cast. CharaId (free-form leader/skin id, e.g. "5000123") and CountryCode (open-ended account data) stay string with proper XML docs; CountryCodes.Korea/Japan name the captured values. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -12,12 +12,25 @@ public sealed record MatchContext(
|
||||
IReadOnlyList<long> SelfDeckCardIds,
|
||||
|
||||
// Player class + leader (BattleStartSelfInfo)
|
||||
string ClassId, // "1".."8"
|
||||
string CharaId, // "1".."8" — equals ClassId when no leader skin chosen
|
||||
|
||||
/// <summary>The player's class. Rendered onto the wire <c>classId</c> as <c>"1".."8"</c> via
|
||||
/// <see cref="CardClassWire.ToWireValue"/>; a closed set, so it's typed, not stringly.</summary>
|
||||
CardClass ClassId,
|
||||
|
||||
/// <summary>Leader/skin id on the wire <c>charaId</c>. FREE-FORM, not a class enum: it's the
|
||||
/// equipped leader-skin id (e.g. <c>"5000123"</c>) when one is chosen, else the class ordinal
|
||||
/// (<c>"1".."8"</c>). Passed through verbatim — the node never interprets it.</summary>
|
||||
string CharaId,
|
||||
|
||||
string CardMasterName, // current card-master, e.g. "card_master_node_10015"
|
||||
|
||||
// Player cosmetics (MatchedSelfInfo)
|
||||
string CountryCode, // "KOR", "JPN", ...
|
||||
|
||||
/// <summary>Account region code, wire <c>country_code</c>. OPEN-ENDED account data (any value,
|
||||
/// possibly empty); the node never branches on it. <see cref="CountryCodes"/> names the values
|
||||
/// seen in captures.</summary>
|
||||
string CountryCode,
|
||||
|
||||
string UserName,
|
||||
string SleeveId,
|
||||
string EmblemId,
|
||||
|
||||
Reference in New Issue
Block a user