feat(battle-engine): full-surface app-type god-object/manager stubs (1692->1586 true)

Make the minimal hand shims partial + generate full member surface for the manager/
task/controller god-objects (LoadingViewManager/DeckUpdateTask/MyPageTask/ReplayController/
PlayerControllerForWatching/WatchDataHandler/EvolutionTouchProcessor/StoryChapterSelection
Utility/NonDialogPopup). NonDialogPopup given MonoBehaviour base + hand Close() removed
(superseded by full surface). LoadTask dup deleted (already copied verbatim). RoomMatch
watch/replay closure types stubbed. Copied 8 more closure files.

CS0246-in-generated-signature masking note: 4 such errors were hiding ~1582 — generated
CS0246 masks as hard as header CS0246; the real frontier is 1586 (CS7036 base-ctor +
member-level), 0 structural.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-05 22:33:37 -04:00
parent fce02a6250
commit 4be630bd09
24 changed files with 2285 additions and 10 deletions

View File

@@ -0,0 +1,27 @@
namespace Wizard;
public class LoadSceneStoryData
{
private const string FORMAT_STORY_TITLE_NAME = "StoryTitle_{0:0000}_1";
private const string FORMAT_STORY_VALUE_NAME = "StoryText_{0:0000}_1";
private const string STILL_TEXTURE_NAME = "bg_story_section_{0}";
public int StoryId { get; private set; }
public string StoryTitle { get; private set; }
public string StoryValue { get; private set; }
public string StillImageName { get; private set; }
public LoadSceneStoryData(int _storyId)
{
StoryId = _storyId;
SystemText systemText = Data.SystemText;
StoryTitle = systemText.Get($"StoryTitle_{StoryId:0000}_1");
StoryValue = systemText.Get($"StoryText_{StoryId:0000}_1");
StillImageName = "Images/Loading/" + $"bg_story_section_{StoryId}";
}
}

View File

@@ -0,0 +1,91 @@
using System.Collections.Generic;
using UnityEngine;
namespace Wizard;
public class LoadingDownLoadStoryView : MonoBehaviour
{
[SerializeField]
private UITexture _stillTexture;
[SerializeField]
private UILabel _storyTitleLabel;
[SerializeField]
private UILabel _storyValueLabel;
[SerializeField]
private UIToggle _indicatorBase;
private List<UIToggle> _indicatorList = new List<UIToggle>();
private List<LoadSceneStoryData> _loadSceneStoryDatas = new List<LoadSceneStoryData>();
private const string FORMAT_STORY_NUMBER = "LoadStory_Number_1";
private int _currentIndex;
public void Initialize()
{
_ = Data.SystemText;
int result = 0;
int.TryParse(Data.SystemText.Get("LoadStory_Number_1"), out result);
GameObject gameObject = _indicatorBase.transform.parent.gameObject;
for (int i = 1; i <= result; i++)
{
_loadSceneStoryDatas.Add(new LoadSceneStoryData(i));
_indicatorList.Add(NGUITools.AddChild(gameObject, _indicatorBase.gameObject).GetComponent<UIToggle>());
}
_indicatorBase.gameObject.SetActive(value: false);
gameObject.GetComponent<UIGrid>().Reposition();
SetStoryInfo(_currentIndex);
}
private void SetStoryInfo(int index)
{
LoadSceneStoryData loadSceneStoryData = _loadSceneStoryDatas[index];
_storyTitleLabel.text = loadSceneStoryData.StoryTitle;
_storyValueLabel.text = loadSceneStoryData.StoryValue;
_stillTexture.mainTexture = Resources.Load<Texture>(loadSceneStoryData.StillImageName);
UpdateIndicator(index);
}
public void ChangeStoryImage(bool isRight)
{
if (isRight)
{
UpdateIndexToNext();
}
else
{
UpdateIndexToPrev();
}
}
private void UpdateIndexToNext()
{
_currentIndex = (_currentIndex + 1) % _loadSceneStoryDatas.Count;
SetStoryInfo(_currentIndex);
}
private void UpdateIndexToPrev()
{
if (_currentIndex > 0)
{
_currentIndex--;
}
else
{
_currentIndex = _loadSceneStoryDatas.Count - 1;
}
SetStoryInfo(_currentIndex);
}
private void UpdateIndicator(int index)
{
if (_indicatorList.Count > 1)
{
_indicatorList[index].value = true;
}
}
}

View File

@@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using Cute;
using UnityEngine;
namespace Wizard;
public class ResourceDownloadCardFactory : MonoBehaviour
{
private List<string> _loadFileList = new List<string>();
private static string GetClassIconPath(CardBasePrm.ClanType classType, bool isFetch)
{
int num = (int)classType;
return Toolbox.ResourcesManager.GetAssetTypePath("class_card_" + num.ToString("00"), ResourcesManager.AssetLoadPathType.CardFrameClassIcon, isFetch);
}
public bool CanView(List<int> cardIdList)
{
foreach (string load in GetLoadList(cardIdList, needCardFrame: true))
{
AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(load);
if (load == null)
{
return false;
}
if (assetHandle.isReDownloadAsset(CustomPreference.IsNormalResource))
{
return false;
}
}
return true;
}
private List<string> GetLoadList(List<int> cardIdList, bool needCardFrame)
{
List<string> cardPath = GetCardPath(cardIdList);
if (needCardFrame)
{
cardPath.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.CardFrame));
}
for (int i = 0; i < 9; i++)
{
cardPath.Add(GetClassIconPath((CardBasePrm.ClanType)i, isFetch: false));
}
return cardPath;
}
public void Load(List<int> cardIdList, GameObject parent, Action<List<CardListTemplate>> onFinish)
{
bool preferSynchronousLoad = true;
List<string> loadList = GetLoadList(cardIdList, needCardFrame: false);
_loadFileList.AddRange(loadList);
loadList.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.CardFrame));
UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroup(loadList, delegate
{
UIManager.GetInstance().AddResidentAtlas(UIAtlasManager.AssetBundleNames.CardFrame);
CreateAllCard(cardIdList, parent, onFinish);
}, isProgress: true, preferSynchronousLoad));
}
private List<string> GetCardPath(List<int> cardIdList)
{
CardMaster.CardMasterId cardMasterId = CardMaster.CardMasterId.Default;
List<string> list = new List<string>();
foreach (int cardId in cardIdList)
{
CardParameter cardParameterFromId = CardMaster.GetInstance(cardMasterId).GetCardParameterFromId(cardId);
string requestPath = GetRequestPath(cardParameterFromId);
if (!string.IsNullOrEmpty(requestPath))
{
list.Add(requestPath);
}
}
return list;
}
private string GetRequestPath(CardParameter param)
{
int resourceCardId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(param.NormalCardId).ResourceCardId;
if (param.CharType == CardBasePrm.CharaType.NORMAL)
{
return Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial);
}
return Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial);
}
private void CreateAllCard(List<int> cardIdList, GameObject parent, Action<List<CardListTemplate>> onFinish)
{
GameObject prefab = Resources.Load("Prefab/Cards/CardListTemplate") as GameObject;
List<CardListTemplate> list = new List<CardListTemplate>();
foreach (int cardId in cardIdList)
{
list.Add(CreateCard(cardId, parent, prefab));
}
onFinish.Call(list);
}
private CardListTemplate CreateCard(int cardId, GameObject parent, GameObject prefab)
{
CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardId);
CardListTemplate component = NGUITools.AddChild(parent, prefab).GetComponent<CardListTemplate>();
component.SetId(cardId);
string text = Data.SystemText.Get($"LoadCard_{cardId}");
component._nameLabel.text = text;
component._newLabel.gameObject.SetActive(value: false);
component.RotationOnlyIconVisible = cardParameterFromId.IsResurgentCard;
if (cardParameterFromId.CharType == CardBasePrm.CharaType.NORMAL)
{
component._atkLabel.text = cardParameterFromId.Atk.ToString();
component._lifeLabel.text = cardParameterFromId.Life.ToString();
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._atkLabel, cardParameterFromId.IsFoil);
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._lifeLabel, cardParameterFromId.IsFoil);
}
component._costLabel.text = cardParameterFromId.Cost.ToString();
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._costLabel, cardParameterFromId.IsFoil);
component._cardTexture.material = UIBase_CardManager.Get2dCardMaterial(cardParameterFromId);
component._cardTexture.transform.localPosition += new Vector3(0f, 0f, 3f);
component._frameSprite.transform.localPosition += new Vector3(0f, 0f, 1f);
component._cardTexture.uvRect = Global.CARD_2D_UV_RECT;
component.SetFrame(cardParameterFromId);
Global.SetRepositionNameLabel(component._nameLabel, text, is2D: true);
UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(component._nameLabel, cardParameterFromId.IsFoil);
component._classIconTexture.mainTexture = ClassCharaPrm.GetClassIconTexture((int)cardParameterFromId.Clan);
component.SetBossRushIconSprite(string.Empty);
return component;
}
private void OnDestroy()
{
Release();
}
public void Release()
{
Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList);
_loadFileList.Clear();
}
}

View File

@@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using LitJson;
namespace Wizard;
public class RoomBattleWatchTaskBase : BaseTask
{
public class UserInfo
{
public int battlePoint;
public int degreeId;
public long emblemId;
public string countryCode;
public int rank;
public string userName;
public int viewerId;
public bool IsOfficialUser { get; set; }
public UserInfo()
{
}
public UserInfo(Dictionary<string, object> data)
{
viewerId = Convert.ToInt32(data["viewerId"]);
countryCode = data["country_code"].ToString();
userName = data["userName"].ToString();
rank = Convert.ToInt32(data["rank"]);
battlePoint = Convert.ToInt32(data["battlePoint"]);
emblemId = Convert.ToInt32(data["emblemId"]);
degreeId = Convert.ToInt32(data["degreeId"]);
IsOfficialUser = Convert.ToInt32(data["isOfficial"]) == 1;
}
}
public int result_reason;
public string node_server_url;
public UserInfo owner_info;
public UserInfo visitor_info;
public BattleParameter BattleParameterInstance { get; private set; }
protected override int Parse()
{
int num = base.Parse();
if (num != 1)
{
return num;
}
JsonData jsonData = base.ResponseData["data"];
result_reason = jsonData["result_reason"].ToInt();
if (result_reason == 0)
{
if (jsonData.Keys.Contains("owner_info"))
{
ParseUserInfo(jsonData["owner_info"], ref owner_info);
}
if (jsonData.Keys.Contains("visitor_info"))
{
ParseUserInfo(jsonData["visitor_info"], ref visitor_info);
}
node_server_url = jsonData["node_server_url"].ToString();
}
if (jsonData.Keys.Contains("is_admin"))
{
bool flag = Convert.ToBoolean(jsonData["is_admin"].ToInt());
GameMgr.GetIns().IsAdmin = flag;
GameMgr.GetIns().HasAuthAdmin = flag;
}
else
{
GameMgr.GetIns().IsAdmin = false;
GameMgr.GetIns().HasAuthAdmin = false;
}
BattleParameterInstance = BattleParameter.JsonToBattleParameter(base.ResponseData["data"]);
if (BattleParameterInstance.BattleType == NetworkDefine.ServerBattleType.RoomTwoPick)
{
GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomTwoPick;
GameMgr.GetIns().GetDataMgr().TwoPickFormat = BattleParameterInstance.TwoPickFormat;
}
else
{
GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomBattle;
}
return num;
}
private void ParseUserInfo(JsonData receive, ref UserInfo info)
{
if (receive != null)
{
info = new UserInfo();
info.viewerId = receive["viewer_id"].ToInt();
info.battlePoint = receive["battlePoint"].ToInt();
info.degreeId = receive["degreeId"].ToInt();
info.emblemId = receive["emblemId"].ToLong();
info.countryCode = receive["country_code"].ToString();
info.rank = receive["rank"].ToInt();
info.userName = receive["userName"].ToString();
info.IsOfficialUser = receive["isOfficial"].ToInt() == 1;
}
}
}