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.
This commit is contained in:
65
SVSim.BattleEngine/Engine/FinishTaskBase.cs
Normal file
65
SVSim.BattleEngine/Engine/FinishTaskBase.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
using Wizard.Battle.Recovery;
|
||||
|
||||
public class FinishTaskBase : BaseTask
|
||||
{
|
||||
protected int classId;
|
||||
|
||||
protected const string data_str = "data";
|
||||
|
||||
public bool IsResponseDataExist(JsonData response)
|
||||
{
|
||||
JsonData jsonData = response["data"];
|
||||
if (jsonData == null || jsonData.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public BattleFinishParam SettingFinishBattleParameter(int class_id, int total_turn, int evolve_count, int enemy_evolve_count, int battle_result, int is_retire)
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
BattleManagerBase ins = BattleManagerBase.GetIns();
|
||||
classId = class_id;
|
||||
BattleFinishParam battleFinishParam = CreateBattleFinishParam(class_id, total_turn, evolve_count, enemy_evolve_count, battle_result, is_retire);
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SELF_DISCONNECT_OPEN_STATUS_TO_REPLACE_LOG, 0f);
|
||||
if (battle_result == 0 && dataMgr.RecoveryData == null && RecoveryRecordManagerBase.IsExistsAINetworkRecoveryFile())
|
||||
{
|
||||
dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_ai_network.json"));
|
||||
}
|
||||
JsonData recoveryData = dataMgr.RecoveryData;
|
||||
if (recoveryData != null)
|
||||
{
|
||||
battleFinishParam.recovery_data = recoveryData.ToJson();
|
||||
}
|
||||
BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true);
|
||||
BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class;
|
||||
battleFinishParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass);
|
||||
base.Params = battleFinishParam;
|
||||
return battleFinishParam;
|
||||
}
|
||||
|
||||
protected virtual BattleFinishParam CreateBattleFinishParam(int class_id, int total_turn, int evolve_count, int enemy_evolve_count, int battle_result, int is_retire)
|
||||
{
|
||||
return new BattleFinishParam
|
||||
{
|
||||
class_id = class_id,
|
||||
total_turn = total_turn,
|
||||
evolve_count = evolve_count,
|
||||
enemy_evolve_count = enemy_evolve_count,
|
||||
battle_result = battle_result,
|
||||
is_retire = is_retire
|
||||
};
|
||||
}
|
||||
|
||||
protected bool IsEffectiveErrorCode(int code)
|
||||
{
|
||||
if (resultCode != 1 && resultCode != 3502)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user