Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
91 lines
2.6 KiB
C#
91 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Cute;
|
|
using LitJson;
|
|
using UnityEngine;
|
|
using Wizard;
|
|
using Wizard.Lottery;
|
|
|
|
public class PracticeResultReporter : IBattleResultReporter
|
|
{
|
|
private readonly GameObject m_reportEndAgentObj;
|
|
|
|
private readonly PracticeReportEndAgent m_reportEndAgent;
|
|
|
|
public bool IsEnd => m_reportEndAgent.IsEnd;
|
|
|
|
public int ClassExp => GetClassExp();
|
|
|
|
public List<UserAchievement> UserAchievement => GetUserAchievementList();
|
|
|
|
public List<UserMission> UserMission => GetUserMissionList();
|
|
|
|
public List<ReceivedReward> MissionRewards => GetRewardsList();
|
|
|
|
public List<ReceivedReward> VictoryRewards => null;
|
|
|
|
public LotteryApplyData LotteryData => Data.PracticeFinish.data.AchievedInfo._lotteryData;
|
|
|
|
public MyPageHomeDialogData HomeDialogData => null;
|
|
|
|
public bool IsDataExist => true;
|
|
|
|
public PracticeResultReporter()
|
|
{
|
|
m_reportEndAgentObj = new GameObject();
|
|
m_reportEndAgent = m_reportEndAgentObj.AddComponent<PracticeReportEndAgent>();
|
|
}
|
|
|
|
public void Report(bool isWin)
|
|
{
|
|
int is_win = (isWin ? 1 : 0);
|
|
StartFinishPractice(is_win, delegate
|
|
{
|
|
m_reportEndAgent.Finished();
|
|
});
|
|
}
|
|
|
|
public void StartFinishPractice(int is_win, Action callback)
|
|
{
|
|
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
|
NetworkManager networkManager = Toolbox.NetworkManager;
|
|
PracticeFinishTask practiceFinishTask = new PracticeFinishTask();
|
|
LocalLog.RecordCheckLog(LocalLog.RecordType.CERBERUS, is_win == 1);
|
|
practiceFinishTask.SetParameter(dataMgr.GetSelectDeckId(), is_win, BattleManagerBase.GetIns().BattlePlayer._cumulativeEvolutionCount, BattleManagerBase.GetIns().BattlePlayer.Turn, dataMgr.GetEnemyClassId(), dataMgr.m_EnemyAIDifficulty, dataMgr.GetSelectDeckFormat(), dataMgr.GetPlayerClassId());
|
|
m_reportEndAgent.StartCoroutine(networkManager.Connect(practiceFinishTask, delegate
|
|
{
|
|
callback.Call();
|
|
}, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode));
|
|
}
|
|
|
|
public void Destroy()
|
|
{
|
|
UnityEngine.Object.Destroy(m_reportEndAgentObj);
|
|
}
|
|
|
|
public JsonData GetFinishResponseData()
|
|
{
|
|
return Data.PracticeFinish.data._responseData;
|
|
}
|
|
|
|
public List<UserAchievement> GetUserAchievementList()
|
|
{
|
|
return Data.PracticeFinish.data.achieved_achievement_list;
|
|
}
|
|
|
|
public List<UserMission> GetUserMissionList()
|
|
{
|
|
return Data.PracticeFinish.data.achieved_mission_list;
|
|
}
|
|
|
|
public List<ReceivedReward> GetRewardsList()
|
|
{
|
|
return Data.PracticeFinish.data.Rewards;
|
|
}
|
|
|
|
public int GetClassExp()
|
|
{
|
|
return Data.PracticeFinish.data.get_class_chara_experience;
|
|
}
|
|
}
|