feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)

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.
This commit is contained in:
gamer147
2026-06-05 17:22:20 -04:00
parent 0d9d8acae0
commit 957af3d1ec
1795 changed files with 166536 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
// AUTHORED SHIM (not copied). Final loose ends for the M1 compile: (1) namespace
// "anchors" -- empty `using` targets in tangentially-copied files reference these
// namespaces, which must merely exist; a single internal anchor type declares them.
// (2) a few concrete tangential types referenced directly. (3) minimal third-party
// serialization/SDK surface. None is on the battle-resolution path.
namespace Wizard.AutoTest { internal class _ShimAnchor { } }
namespace Wizard.Title { internal class _ShimAnchor { } }
namespace Wizard.ErrorDialog { internal class _ShimAnchor { } }
namespace Wizard.Bingo { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Data.TaskData.ItemPurchase { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Data.TaskData.SkinPurchase { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Data.TaskData.SpotCardExchange { internal class _ShimAnchor { } }
// These are NAMESPACES (used as `using` targets in copied files), not types.
namespace Wizard.DeckSelect.FirstDisplayPageIndexGetter { internal class _ShimAnchor { } }
namespace Wizary.StorySelectionWorld { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Data.TableData.Arena.TwoPick { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Data.TaskData.Arena { public class Reward { } }
// IManager: a Cute manager interface implemented by NetworkManager/ResourcesManager.
namespace Cute { public interface IManager { } }
// ---- third-party serialization / SDK (minimal surface) ----
namespace MessagePack
{
public static class MessagePackSerializer
{
public static byte[] Serialize<T>(T obj) => new byte[0];
public static T Deserialize<T>(byte[] bytes) => default;
public static string ToJson(byte[] bytes) => "";
public static byte[] FromJson(string json) => new byte[0];
}
}
namespace MiniJSON
{
public static class Json
{
public static object Deserialize(string json) => null;
public static string Serialize(object obj) => "";
}
}
namespace Steamworks
{
// Steam callback wrapper (engine only references the type).
public sealed class Callback<T> { }
}

View File

@@ -0,0 +1,44 @@
// AUTHORED SHIM (not copied). Third-party / platform SDK surface referenced by
// tangentially-pulled engine files (audio, Steam, networking, serialization).
// Stubbed minimally in their original namespaces; none is on the battle-resolution
// path. Members grow only if the compile loop demands them.
using System;
// ---- remaining UnityEngine types ----
namespace UnityEngine
{
public class Font : Object { }
public enum Space { World, Self }
// NGUI's UIInputOnGUI reads Event.current (legacy IMGUI event).
public class Event { public static Event current => null; }
}
namespace UnityEngine.Networking
{
public class UnityWebRequest : IDisposable { public void Dispose() { } }
}
// ---- CRI Atom audio middleware ----
namespace CriWare
{
public class CriAtomSource { }
public class CriAtom { }
}
// ---- Steamworks.NET ----
namespace Steamworks
{
public struct GetAuthSessionTicketResponse_t { }
}
// ---- BestHTTP Socket.IO ----
namespace BestHTTP.SocketIO
{
public interface IManager { }
}
// ---- Google Play Games ----
namespace GooglePlayGames.BasicApi.Events
{
public class Event { }
}

View File

@@ -0,0 +1,61 @@
// AUTHORED SHIM (not copied). The god-object singletons the engine reaches for
// presentation/scene/effects. These are the M0 "stop the bleed" types: copying
// them would re-explode the closure into the whole app (audio, scene, UI, net),
// so we shim a minimal surface. The nested enums below are presentation
// classifiers used only inside never-run VFX actions (IsForecast suppresses VFX),
// so their VALUES are immaterial to game state -- but the symbols the engine
// references must exist to compile. Members listed are exactly those the compiler
// demanded (extracted from the copied engine, not guessed).
// (Global namespace: the decomp root files declare no namespace.)
public class EffectMgr
{
public enum EffectType
{
NONE,
CMN_CARD_ACCELERATE_1, CMN_CARD_CRYSTALLIZE_1, CMN_CARD_SELECT_3,
CMN_CARD_SET_1, CMN_CARD_SET_2, CMN_CARD_SET_3,
CMN_CARD_TARGET_1, CMN_CARD_TARGET_2,
CMN_CRAFT_CARD_1, CMN_CRAFT_CARD_2, CMN_CRAFT_ICON_1,
CMN_CRAFT_SPLASH_1, CMN_CRAFT_SPLASH_2, CMN_CRAFT_SPLASH_3, CMN_CRAFT_SPLASH_4,
CMN_CRAFT_TRACK_1, CMN_FRAME_BTN_1, CMN_FRAME_BTN_2,
CMN_GACHA_CURSOR_1, CMN_GACHA_OPEN_2, CMN_GACHA_OPEN_3, CMN_GACHA_OPEN_4,
CMN_INPUT_DRAG_1, CMN_INPUT_TOUCH_1, CMN_INPUT_TOUCH_2,
CMN_RESULT_BACK_1, CMN_RESULT_BACK_2, CMN_RESULT_BACK_3,
CMN_RESULT_FAILED_1, CMN_RESULT_GAUGE_1, CMN_RESULT_GAUGE_2,
CMN_RESULT_LVUP_1, CMN_RESULT_MATCH_1, CMN_RESULT_ORB_1, CMN_RESULT_ORB_2,
CMN_RESULT_RANKDOWN_1, CMN_RESULT_RANKUP_1, CMN_RESULT_TIERUP_1,
CMN_START_CARD_1, CMN_START_VS_1, CMN_START_VS_ST2,
CMN_UI_TURN_1, CMN_UI_TURN_5, CMN_UI_TURN_6,
}
public enum MoveType { NONE, DIRECT, DIRECT_HAND, DIRECT_LEADER }
public enum TargetType { NONE, NONE_WAIT, SINGLE, SINGLE_ONLY_OPPONENT, AREA_ALL, AREA_OPPONENT, AREA_SELF }
public enum EngineType { NONE, SHURIKEN, SOLID }
}
public class UIManager
{
public static UIManager GetIns() => _ins ??= new UIManager();
private static UIManager _ins;
public enum ViewScene
{
None, Battle, Bingo, BuildDeckPurchasePage, CardAllList, CardSleevePurchasePage,
ClassSkinPurchasePage, Colosseum, CrossoverPortal, DeckList, Gacha, Gathering,
LeaderPopularityVote, LoginBonus, LotteryPage, Mission, MyPage,
NeutralPopularityVote, Profile, QuestSelectionPage, RankMatch, Room,
StorySelectPage, StorySelectionWorld, TwoPick,
}
public class ChangeViewSceneParam { }
}
public class GameMgr
{
public static GameMgr GetIns() => _ins ??= new GameMgr();
private static GameMgr _ins;
public bool IsAdminWatch => false;
public bool IsWatchBattle => false;
public bool IsReplayBattle => false;
public EffectMgr GetEffectMgr() => _effect ??= new EffectMgr();
private EffectMgr _effect;
}

View File

@@ -0,0 +1,166 @@
// AUTHORED SHIM (not copied). No-op UnityEngine surface for headless battle
// resolution. Grows via the M1 compile loop -- add only members the compiler
// demands. State-bearing battle logic lives in Engine/; nothing here computes
// game state (Unity calls are VFX/IO/rendering, suppressed by IsForecast).
using System;
using System.Collections;
namespace UnityEngine
{
// ---- value types (Vector2/3, Quaternion, Color, Mathf, Debug live in Primitives.cs) ----
public struct Vector4 { public float x, y, z, w; public Vector4(float x, float y, float z, float w){ this.x=x; this.y=y; this.z=z; this.w=w; } }
public struct Color32 { public byte r, g, b, a; public Color32(byte r, byte g, byte b, byte a){ this.r=r; this.g=g; this.b=b; this.a=a; } }
public struct Bounds { public Vector3 center, size; public Bounds(Vector3 c, Vector3 s){ center=c; size=s; } }
public struct Rect { public float x, y, width, height; public Rect(float x, float y, float w, float h){ this.x=x; this.y=y; width=w; height=h; } }
public struct Matrix4x4 { public static Matrix4x4 identity => new Matrix4x4(); }
public struct Plane { }
public struct Ray { }
public struct RaycastHit { }
public struct LayerMask { public int value; public static int NameToLayer(string n) => 0; public static implicit operator int(LayerMask m) => m.value; }
// ---- core object model ----
public class Object
{
public string name { get; set; }
public int GetInstanceID() => 0;
public override string ToString() => name ?? base.ToString();
public static void Destroy(Object o) { }
public static void Destroy(Object o, float t) { }
public static void DestroyImmediate(Object o) { }
public static void DontDestroyOnLoad(Object o) { }
public static T Instantiate<T>(T original) where T : Object => original;
public static T FindObjectOfType<T>() where T : Object => null;
public static bool operator ==(Object a, Object b) => ReferenceEquals(a, b);
public static bool operator !=(Object a, Object b) => !ReferenceEquals(a, b);
public static implicit operator bool(Object o) => !ReferenceEquals(o, null);
public override bool Equals(object o) => ReferenceEquals(this, o);
public override int GetHashCode() => System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(this);
}
public class Component : Object
{
public Transform transform => null;
public GameObject gameObject => null;
public T GetComponent<T>() => default;
public T GetComponentInChildren<T>() => default;
public T[] GetComponentsInChildren<T>() => new T[0];
public T GetComponentInParent<T>() => default;
}
public class Behaviour : Component { public bool enabled { get; set; } }
public class MonoBehaviour : Behaviour
{
public Coroutine StartCoroutine(IEnumerator routine) => null;
public Coroutine StartCoroutine(string methodName) => null;
public void StopCoroutine(IEnumerator routine) { }
public void StopCoroutine(Coroutine routine) { }
public void StopAllCoroutines() { }
public void Invoke(string methodName, float time) { }
public void CancelInvoke() { }
public bool IsInvoking() => false;
}
public class Transform : Component, IEnumerable
{
public Vector3 position { get; set; }
public Vector3 localPosition { get; set; }
public Vector3 localScale { get; set; } = new Vector3(1, 1, 1);
public Vector3 localEulerAngles { get; set; }
public Vector3 eulerAngles { get; set; }
public Quaternion rotation { get; set; }
public Quaternion localRotation { get; set; }
public Transform parent { get; set; }
public int childCount => 0;
public Transform Find(string n) => null;
public Transform GetChild(int i) => null;
public void SetParent(Transform p) { }
public void SetParent(Transform p, bool worldPositionStays) { }
public void SetSiblingIndex(int i) { }
public int GetSiblingIndex() => 0;
public void SetAsLastSibling() { }
public void SetAsFirstSibling() { }
public IEnumerator GetEnumerator() { yield break; }
}
public class GameObject : Object
{
public GameObject() { }
public GameObject(string name) { this.name = name; }
public Transform transform => null;
public bool activeSelf => false;
public bool activeInHierarchy => false;
public int layer { get; set; }
public string tag { get; set; }
public void SetActive(bool value) { }
public T GetComponent<T>() => default;
public T GetComponentInChildren<T>() => default;
public T AddComponent<T>() where T : Component => default;
public Component AddComponent(Type t) => null;
public static GameObject Find(string n) => null;
}
public class ScriptableObject : Object { }
// ---- rendering / physics / audio (pure no-op presentation) ----
public class Renderer : Component { public Material material { get; set; } public Material[] materials { get; set; } public bool enabled { get; set; } }
public class MeshRenderer : Renderer { }
public class SkinnedMeshRenderer : Renderer { }
public class SpriteRenderer : Renderer { public Sprite sprite { get; set; } }
public class MeshFilter : Component { public Mesh mesh { get; set; } }
public class ParticleSystem : Component { }
public class ParticleSystemRenderer : Renderer { }
public class LODGroup : Component { }
public class Collider : Component { public bool enabled { get; set; } }
public class BoxCollider : Collider { }
public class Rigidbody : Component { }
public class Rigidbody2D : Component { }
public class Material : Object { public Material() { } public Material(Material src) { } public Color color { get; set; } public void SetFloat(string n, float v) { } public void SetColor(string n, Color c) { } public void SetTexture(string n, Texture t) { } }
public class Mesh : Object { }
public class Texture : Object { }
public class Texture2D : Texture { public Texture2D(int w, int h) { } }
public class RenderTexture : Texture { }
public class Sprite : Object { }
public class Shader : Object { public static Shader Find(string n) => null; }
public class AnimationClip : Object { }
public class Animation : Component { }
public class Animator : Component { }
public class AnimationCurve { }
public class AudioClip : Object { }
public class AudioSource : Component { }
public class Camera : Component { public static Camera main => null; }
public struct CharacterInfo { }
// ---- coroutine machinery (never pumped headless; types must exist) ----
public class YieldInstruction { }
public sealed class Coroutine : YieldInstruction { }
public sealed class WaitForEndOfFrame : YieldInstruction { }
public sealed class WaitForSeconds : YieldInstruction { public WaitForSeconds(float s) { } }
public sealed class WaitForFixedUpdate : YieldInstruction { }
// ---- input ----
public struct Touch { public int fingerId; public Vector2 position; public TouchPhase phase; }
// ---- enums (grow members as the compiler demands) ----
public enum FontStyle { Normal, Bold, Italic, BoldAndItalic }
public enum TouchPhase { Began, Moved, Stationary, Ended, Canceled }
public enum KeyCode { None }
// ---- attributes: permissive ctors accept any compile-time attribute args ----
public class SerializeField : Attribute { }
public class HideInInspector : Attribute { }
public class ExecuteInEditMode : Attribute { }
public class AddComponentMenu : Attribute { public AddComponentMenu(string n) { } public AddComponentMenu(string n, int o) { } }
public class ContextMenu : Attribute { public ContextMenu(string n) { } }
public class RequireComponent : Attribute { public RequireComponent(Type a) { } public RequireComponent(Type a, Type b) { } }
public class HeaderAttribute : Attribute { public HeaderAttribute(string h) { } }
public class TooltipAttribute : Attribute { public TooltipAttribute(string t) { } }
public class SpaceAttribute : Attribute { public SpaceAttribute() { } public SpaceAttribute(float h) { } }
public class RangeAttribute : Attribute { public RangeAttribute(float min, float max) { } }
public class MultilineAttribute : Attribute { public MultilineAttribute() { } public MultilineAttribute(int lines) { } }
// ---- subsystem singletons / statics ----
public static class Application { public static bool isEditor => false; public static bool isPlaying => true; public static string persistentDataPath => ""; }
public static class Time { public static float deltaTime => 0f; public static float time => 0f; public static float unscaledDeltaTime => 0f; public static int frameCount => 0; }
public static class Screen { public static int width => 1920; public static int height => 1080; }
}

View File

@@ -0,0 +1,114 @@
// AUTHORED SHIM (not copied). The VFX layer, headless. VfxBase mirrors the real
// public surface (see decomp Wizard.Battle.View.Vfx/VfxBase.cs) so the ~800 engine
// call sites that pass/return VfxBase compile unchanged. Containers preserve the
// CONTROL-FLOW contract (Register collects, IsVfxNonEmpty reflects child count) but
// perform NO rendering. InstantVfx stores its action and NEVER runs it: headless
// resolution runs with IsForecast=true so VFX is never played, and per design §3.3
// all state mutation happens synchronously in the skill methods BEFORE the VFX is
// built -- so a never-played VFX loses no game state.
using System;
using System.Collections.Generic;
namespace Wizard.Battle.View.Vfx
{
public interface IEffectVfx { }
public class VfxBase
{
public virtual bool IsEnd { get; protected set; } = true;
public virtual string CurrentVfxName => GetType().ToString();
public virtual void Update(float dt, List<IEffectVfx> effectVfxList) { }
public virtual void Play() { }
public virtual VfxBase Cancel() => this;
public virtual bool IsVfxNonEmpty() => false;
public virtual List<string> GetVfxNames() => new List<string>();
}
public sealed class NullVfx : VfxBase
{
private static readonly NullVfx _ins = new NullVfx();
public static NullVfx GetInstance() => _ins;
public override bool IsVfxNonEmpty() => false;
}
public sealed class InstantVfx : VfxBase
{
// Stored, never invoked (headless suppression -- see file header).
private Action _action;
public static InstantVfx Create(Action action) => new InstantVfx { _action = action };
public override bool IsVfxNonEmpty() => true;
}
public sealed class WaitVfx : VfxBase
{
public static WaitVfx Create(float seconds) => new WaitVfx();
public override bool IsVfxNonEmpty() => false;
}
// Container players: collect children, report non-empty by count, render nothing.
public class SequentialVfxPlayer : VfxBase
{
protected readonly List<VfxBase> _children = new List<VfxBase>();
public static SequentialVfxPlayer Create() => new SequentialVfxPlayer();
public void Register(VfxBase vfx) { if (vfx != null) _children.Add(vfx); }
public int Count() => _children.Count;
public override bool IsVfxNonEmpty()
{
foreach (var c in _children) { if (c != null && c.IsVfxNonEmpty()) return true; }
return false;
}
}
public class ParallelVfxPlayer : SequentialVfxPlayer
{
public static new ParallelVfxPlayer Create() => new ParallelVfxPlayer();
}
public class VfxWithLoading : SequentialVfxPlayer
{
public static new VfxWithLoading Create() => new VfxWithLoading();
}
public class VfxWithLoadingSequential : SequentialVfxPlayer
{
public static new VfxWithLoadingSequential Create() => new VfxWithLoadingSequential();
}
// Non-generic base (engine references bare `VfxWith` as well as the generics).
public class VfxWith : VfxBase
{
public VfxBase Vfx { get; set; }
}
// One-value pair (engine reads .Value / .Vfx).
public class VfxWith<T> : VfxWith
{
public T Value { get; set; }
public VfxWith() { }
public VfxWith(T value, VfxBase vfx) { Value = value; Vfx = vfx; }
}
// Two-value pair (engine reads .Value_1 / .Value_2 / .Vfx).
public class VfxWith<T1, T2> : VfxWith
{
public T1 Value_1 { get; set; }
public T2 Value_2 { get; set; }
public VfxWith() { }
public VfxWith(VfxBase vfx, T1 value1, T2 value2) { Vfx = vfx; Value_1 = value1; Value_2 = value2; }
}
public class EvolveVfxBase : VfxBase { }
public class CanNotTouchCardVfx : VfxBase { }
public interface ICardVfxCreator { }
public interface IBattleCardVfxCreator { }
// The VFX manager: headless, registration is suppressed (real VfxMgr early-returns
// when IsForecast; we no-op unconditionally since we never pump the render loop).
public class VfxMgr
{
public void RegisterImmediateVfx<T>(T vfx) where T : VfxBase { }
public void Register<T>(T vfx) where T : VfxBase { }
public void Clear() { }
}
}

View File

@@ -0,0 +1,86 @@
// AUTHORED SHIM (not copied). The battle View / UI / Touch / Replay / RoomMatch
// presentation tree the engine holds references to but never drives headless
// (IsForecast suppresses VFX; we never pump input or rendering). Stubbed in their
// ORIGINAL namespaces so the copied engine's type references resolve. Members grow
// only as the compile loop demands a specific call. Most are referenced as field/
// parameter types only, so empty stubs suffice.
namespace Wizard.Battle.View
{
public interface IReadOnlyVoiceInfo { }
public class BattleCardView
{
public class BuildInfo { }
public class AttackTargetSelectInfo { }
}
public class NonDialogPopup { public virtual void Close() { } }
public abstract class BattlePlayerViewBase
{
public enum BattleDialogItem { Menu, Retire }
}
public class InPlayCardFrameEffectControl { }
}
namespace Wizard.Battle.UI
{
public class BattleLogItem
{
public enum CardTextureOption { Null, ForceNormal, ForceEvolution }
}
public class BattleLogManager { }
public class AvatarBattleTitleItem { }
public class AvatarBattlePassiveBonusItem { }
public class AvatarBattleBonusItem { }
public class BossRushEnemySpecialSkillItem { }
public class MyRotationBonusItem { }
public class EvolutionConfirmation { }
}
namespace Wizard.Battle.Touch
{
public class SkillTargetSelectTouchProcessor { }
public class EvolutionTouchProcessor { }
public class SetCardProcessor { }
public class EvolutionSimpleProcessor { }
public class EmotionTouchProcessor { }
public class DetailPanelTouchProcessor { }
public class ClassBuffTouchProcessor { }
}
namespace Wizard.Battle.Replay
{
public interface IReplayRecordManager { }
public class NetworkBattleReplayOperationRecorder
{
public class RecordBattleLogParameter { }
}
}
namespace Wizard.Replay
{
public class ReplayController { }
}
namespace Wizard.RoomMatch
{
public class WatchDataHandler { }
public class RoomConnectController
{
public enum BattleRule { None, Bo1 }
}
}
namespace Wizard.Story
{
public class StoryRecoveryData { }
}
namespace Wizard.UI.Common
{
public class TabList { }
}
namespace Wizard.UI.Dialog.ImageSelection
{
public class ImageSelection { }
}