Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryOperationInfo.cs
gamer147 0d9d8acae0 feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
2026-06-05 16:57:20 -04:00

60 lines
2.0 KiB
C#

using System.Collections.Generic;
using System.IO;
using System.Linq;
using Cute;
using LitJson;
using Wizard.AutoTest;
using Wizard.Battle.Operation;
namespace Wizard.Battle.Recovery;
public class RecoveryOperationInfo
{
public DataMgr.BattleType BattleType { get; private set; }
public long RecordTime { get; private set; }
public SetupConditionInfo SetupInfo { get; private set; }
public IEnumerable<IOperationCommand> ActionCommands { get; private set; }
public ResultConditionInfo CheckInfo { get; private set; }
public IEnumerable<string> SkillTargetCardNames { get; private set; }
public long MulliganStartTime { get; private set; }
public long TurnStartTime { get; private set; }
public long OpeningStartTime { get; private set; }
public RecoveryOperationInfo(string filePath)
{
JsonData jsonData = ReadRecoveryFile(filePath);
BattleType = (DataMgr.BattleType)jsonData.ToIntOrDefault("battle_type", 100);
MulliganStartTime = jsonData["setup"].ToLongOrDefault("start_mulligan_time", 0);
OpeningStartTime = jsonData["setup"].ToLongOrDefault("opening_start_time", 0);
TurnStartTime = jsonData.ToLongOrDefault("turn_start_time", 0);
RecordTime = jsonData.ToLongOrDefault("record_time", 0);
SetupInfo = new SetupConditionInfo(jsonData["setup"], BattleType);
ActionCommands = AutoTestBattleMgr.CreateOperationCommands(jsonData.ToJsonDataCollection("operations"), SetupInfo.DidPlayerGoFirst);
CheckInfo = new ResultConditionInfo(jsonData["check"]);
SkillTargetCardNames = from n in jsonData.ToJsonDataCollection("skill_targets")
select n.ToString();
}
public static JsonData ReadRecoveryFile(string filePath)
{
JsonData result = new JsonData();
using (StreamReader streamReader = new StreamReader(filePath))
{
string text = streamReader.ReadToEnd();
if (!string.IsNullOrEmpty(text))
{
result = JsonMapper.ToObject(CryptAES.decryptForNode(text));
}
}
return result;
}
}