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:
114
SVSim.BattleEngine/Shim/View/VfxShim.cs
Normal file
114
SVSim.BattleEngine/Shim/View/VfxShim.cs
Normal 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() { }
|
||||
}
|
||||
}
|
||||
86
SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs
Normal file
86
SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs
Normal 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 { }
|
||||
}
|
||||
Reference in New Issue
Block a user