// AUTHORED SHIM (not copied). The god-object singletons the engine reaches for // presentation/scene/effects/sound/data. These are the M0 "stop the bleed" types: // copying them re-explodes the closure into the whole app (audio, scene, UI, net), // so we shim a minimal surface. Manager GETTERS return the (copied) manager types as // null fields -- the engine only dereferences them inside never-run VFX (IsForecast // suppresses VFX) or non-battle code paths, so a null is harmless headless and avoids // constructing copied types with heavy ctors. Member signatures mirror the decomp // exactly (extracted, not guessed) so call sites compile unchanged. using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class EffectMgr { public enum EffectType { NONE, CMN_CARD_DRAW_2, CMN_CARD_SET_1, CMN_CARD_SET_2, CMN_CARD_SET_3, CMN_CARD_ACCELERATE_1, CMN_CARD_CRYSTALLIZE_1, CMN_CARD_TARGET_1, CMN_CARD_TARGET_2, CMN_CARD_SELECT_3, CMN_UI_TURN_1, CMN_UI_TURN_5, CMN_UI_TURN_6, CMN_FRAME_BTN_1, CMN_RESULT_TITLE_2, CMN_RESULT_TITLE_3, CMN_FIELD_SET_1, CMN_FIELD_SET_2, CMN_FIELD_SET_3, CMN_FIELD_SET_4, CMN_FIELD_SET_5, CMN_FIELD_SET_6, CMN_FIELD_SET_7, CMN_FIELD_SET_8, CMN_FIELD_SET_9, CMN_FIELD_SET_10, CMN_FIELD_SET_20, CMN_FIELD_SET_21, CMN_FIELD_SET_22, CMN_FIELD_SET_23, CMN_FIELD_SET_30, CMN_FIELD_SET_31, CMN_FIELD_SET_32, CMN_FIELD_SET_33, CMN_FIELD_SET_34, CMN_FIELD_SET_41, CMN_FIELD_SET_42, CMN_FIELD_SET_43, CMN_FIELD_SET_51, CMN_FIELD_SET_52, CMN_FIELD_SET_61, CMN_FIELD_SET_62, CMN_FIELD_SET_71, CMN_FIELD_SET_72, CMN_FIELD_SET_74, CMN_FIELD_SET_76, CMN_FIELD_SET_1001, CMN_FIELD_SET_1002, CMN_FIELD_SET_1003, CMN_FIELD_SET_1004, CMN_FIELD_SET_1005, CMN_FIELD_SET_1006, CMN_FIELD_SET_1007, CMN_FIELD_SET_1008, CMN_FIELD_SET_1009, CMN_FIELD_SET_1010, CMN_FIELD_SET_1011, CMN_FIELD_SET_1012, CMN_FIELD_TAP_1_1, CMN_FIELD_TAP_1_2, CMN_FIELD_TAP_2_1, CMN_FIELD_TAP_3_1, CMN_FIELD_TAP_3_2, CMN_FIELD_TAP_4_1, CMN_FIELD_TAP_4_2, CMN_FIELD_TAP_5_1, CMN_FIELD_TAP_6_1, CMN_FIELD_TAP_6_2, CMN_FIELD_TAP_7_1, CMN_FIELD_TAP_8_1, CMN_FIELD_TAP_9_1, CMN_FIELD_TAP_10_1, CMN_FIELD_TAP_10_2, CMN_FIELD_TAP_20_1, CMN_FIELD_TAP_20_2, CMN_FIELD_TAP_21_1, CMN_FIELD_TAP_21_2, CMN_FIELD_TAP_22_1, CMN_FIELD_TAP_23_1, CMN_FIELD_TAP_23_2, CMN_FIELD_TAP_30_1, CMN_FIELD_TAP_31_1, CMN_FIELD_TAP_31_2, CMN_FIELD_TAP_32_1, CMN_FIELD_TAP_33_1, CMN_FIELD_TAP_33_2, CMN_FIELD_TAP_34_1, CMN_FIELD_TAP_41_1, CMN_FIELD_TAP_42_1, CMN_FIELD_TAP_43_1, CMN_FIELD_TAP_51_1, CMN_FIELD_TAP_52_1, CMN_FIELD_TAP_61_1, CMN_FIELD_TAP_61_2, CMN_FIELD_TAP_62_1, CMN_FIELD_TAP_71_1, CMN_FIELD_TAP_72_1, CMN_FIELD_TAP_74_1, CMN_FIELD_TAP_76_1, CMN_FIELD_TAP_1001_1, CMN_FIELD_TAP_1002_1, CMN_FIELD_TAP_1003_1, CMN_FIELD_TAP_1004_1, CMN_FIELD_TAP_1005_1, CMN_FIELD_TAP_1006_1, CMN_FIELD_TAP_1007_1, CMN_FIELD_TAP_1007_2, CMN_FIELD_TAP_1008_1, CMN_FIELD_TAP_1009_1, CMN_FIELD_TAP_1010_1, CMN_FIELD_TAP_1011_1, CMN_FIELD_TAP_1012_1, CMN_TUTORIAL_TAP_1, CMN_CRAFT_CARD_1, CMN_CRAFT_CARD_2, CMN_CRAFT_ICON_1, CMN_CRAFT_TRACK_1, CMN_CRAFT_SPLASH_1, CMN_CRAFT_SPLASH_2, CMN_CRAFT_SPLASH_3, CMN_CRAFT_SPLASH_4, CMN_MAP_CHAPTER_1, CMN_MAP_MAPICON_CLEARED, CMN_MAP_MAPICON_NOTCLEARED, CMN_MAP_PLAYERICON, } public static System.Collections.IEnumerator LoadAndInstantiate2dEffectCoroutine(string effectName, System.Action> finishCallback) { yield break; } public enum MoveType { NONE, SKIP, DIRECT, DIRECT_HAND, DIRECT_DECK, DIRECT_LEADER, CENTER } public enum TargetType { NONE, NONE_WAIT, SINGLE, SINGLE_ONLY_OPPONENT, AREA_ALL, AREA_OPPONENT, AREA_SELF } public enum EngineType { NONE, SHURIKEN} public bool IsFieldEffectReady => true; public bool IsBattleUIEffectReady => true; public Effect Start(EffectType type, Vector3 pos, Quaternion rot, int layer = -1) => null; public Effect Start(EffectType type, Vector3 pos, GameObject obj = null) => null; public Effect Start(EffectType type, float posX, float posY) => null; public Effect Start(EffectType type) => null; public Effect StartBuff(EffectType type, GameObject obj) => null; public Effect StopBuff(EffectType type, GameObject obj) => null; public Effect Stop(EffectType type) => null; public List InitCommonEffect(string filePath, bool isBattle = false, bool isField = false, bool isBattleEffect = false, Action callback = null) => new List(); public List SetUIParticleShader(List effectObjList, Action callback, bool isBattle = false, bool isField = false) => new List(); public List SetUIParticleShader(GameObject effectObj, Action callback, bool isBattle = false, bool isField = false) => new List(); public void ChangeMaskShader(GameObject effectObj, int stencil = 1) { } public void DisposeLatestMadeEffects() { } public void ClearLastCacheEffect() { } public void DestroyBattleEffectContainer() { } public void ImmediateDestroyBattleEffectContainer() { } public void ClearBattleFeildEffect() { } public void RestUnneededEffect() { } public EffectBattle GetEffectBattle(string key) => null; public EffectBattle GetEnemyEffectBattle(string key) => null; public static MoveType ToStrMoveType(string str) => MoveType.NONE; public static EngineType ToStrEngineType(string str) => EngineType.NONE; public static TargetType ToStrTargetType(string str) => TargetType.NONE; } public partial class GameObjMgr { public GameObjMgr() { } } public class GameMgr { // Phase-5 chunk 47: the ambient is gone. GameMgr.GetIns() has no scope-based mechanism — // BattleManagerBase.GetIns() returns null unconditionally, and every direct engine consumer // was migrated to per-mgr reads through the mgr's own `.GameMgr` property. The residual // static throws to catch any straggler that still calls it; MultiInstanceEngineTests pins // the null-null-throw shape. public static GameMgr GetIns() => throw new System.InvalidOperationException( "GameMgr.GetIns() is retired. Read via `mgr.GameMgr` on a BattleManagerBase instance."); public GameObject m_GameManagerObj; public float ScreenAspect = 1.777f; public DateTime AnnounceTime; // Six mode flags collapsed to const-false getters in Phase 4 (2026-07-02): headless // is neither watching, replaying, admin-watching, an AI-network client, a puzzle // quest, nor a "new replay" — every branch guarded on `!IsWatchBattle` etc. was a // tautology, and every branch guarded on the positive was dead code. Setters // dropped: pre-Phase-4 callers wrote `false` at end-of-battle cleanup which is now // unnecessary. public bool IsAdminWatch => false; public bool IsWatchBattle => false; public bool IsReplayBattle => false; public bool IsAINetwork => false; public bool IsPuzzleQuest => false; public bool IsNewReplayBattle => false; public bool IsAdmin => false; // IsNetworkBattle stays writable — headless PvP battles set true; SingleBattleMgr paths stay false. public bool IsNetworkBattle { get; set; } private EffectMgr _effect; private DataMgr _data; private GameObjMgr _gameObj = new GameObjMgr(); private PrefabMgr _prefab; private InputMgr _input; private BattleControl _battleCtrl; private NetworkUserInfoData _netUser; public EffectMgr GetEffectMgr() => _effect ??= new EffectMgr(); // Headless: hand back non-null no-op instances. The copied manager types are pure // data/dictionary/no-op holders (no Unity in their ctors); the resolution-path ctor // dereferences these immediately (CreateBackgroundId / CreateManager / UnityEventAgent wiring). public DataMgr GetDataMgr() => _data ??= new DataMgr(); public GameObjMgr GetGameObjMgr() => _gameObj; public PrefabMgr GetPrefabMgr() => _prefab ??= new PrefabMgr(); public InputMgr GetInputMgr() => _input ??= new InputMgr(); public BattleControl GetBattleCtrl() => _battleCtrl ??= new BattleControl(); public NetworkUserInfoData GetNetworkUserInfoData() => _netUser; public void SetNetworkUserInfoData(NetworkUserInfoData infoData) => _netUser = infoData; public Wizard.MailTopTask GetMailTopTask() => null; public Wizard.DeckUpdateTask GetDeckUpdateTask() => null; public Wizard.CardDestructTask GetCardDestructTask() => null; public Wizard.CardCreateTask GetCardCreateTask() => null; public Wizard.MissionInfoTask GetMissionInfoTask() => null; public void DestroyBattleManagements() { } public bool IsUseUnapprovedList(bool isPlayer) => false; } // UIManager surface (members, ViewScene enum, ChangeViewSceneParam) is generated from // decomp into Shim/Generated/UIManager*.g.cs. This partial keeps only the singleton + // MonoBehaviour base (gameObject/transform/StartCoroutine/StopCoroutine come from the base). public partial class UIManager : UnityEngine.MonoBehaviour { private static UIManager _ins; public static UIManager GetInstance() => _ins ??= new UIManager(); } // VideoHostingHUD (members + HUDMode enum) provided by Generated/VideoHostingHUD.g.cs namespace Wizard { // RankWinnerReward, CardDestructTask, CardCreateTask, MissionInfoTask already exist // in the copied set (declared in other files) -- only these three were missing. public partial class MailTopTask { } public partial class DeckUpdateTask { } // UIManager no-op return types (empty stubs; methods returning them return null) public partial class LoadingViewManager { } public partial class AccountTransferHelper { } public class DialogManager { public DialogBase CreateDialogBaseOpenCardDetail(CardDetailUI detailUI) => default!; } public partial class ApplicationFinishManager { } }