Files
SVSimServer/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs
gamer147 2b506574e7 feat(battle-engine-port): M2 step 1 — SingleBattleMgr constructs headless
First green of the M2 go/no-go probe: `new SingleBattleMgr(StandardBattleMgr-
ContentsCreator)` now builds the two-player pair fully headless against the shim,
no Unity runtime. Verdict: headless construction is feasible; every blocker was a
mechanical no-op shim fill or data seam, not a Unity/logic wall.

Shim fills (authored):
- GameMgr: lazy non-null DataMgr/PrefabMgr/InputMgr/SoundMgr/BattleControl.
- GameObject: lazy cached component model so GetComponent<T>/AddComponent<T> return
  non-null no-op instances for Component-derived T (F1: unguarded view touches).
- Resources.Load(string): cached non-null GameObject so the prefab->Instantiate->
  GetComponent chain (UnityEventAgent) yields a real object.
- ClassBattleCardViewBase: re-attach dropped IClassBattleCardView (no-op members);
  ClassBattleCardBase.Setup casts the created view to it.

Engine copy (DP1/DP3 mis-cut fix):
- CardIconControl.cs copied verbatim (manifested) + generated null-stub deleted.
  SplitAndCompleteIconStr is pure string logic on the resolution path that M1 had
  wrongly stubbed as "View" -> null deref in SkillCreator.CreateBuildInfo.

Test harness (SVSim.BattleEngine.Tests, authored fixture):
- HeadlessContentsCreator/HeadlessPhaseCreator: deterministic replica of the solo
  practice init (StandardBattleMgrContentsCreator + SingleBattlePhaseCreator) with
  no-op recovery/replay managers.
- HeadlessCardMaster: reflects the loader cards.json dump into CardMaster.
- HeadlessMasterData: minimal Data.Master (class-character list, empty collections)
  + Data.Load + player/enemy chara ids.
- ConstructionProbeTests.SingleBattleMgr_constructs_headless — GREEN.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 01:36:22 -04:00

186 lines
8.2 KiB
C#

// AUTHORED SHIM (not copied). Non-battle game types (settings widgets, error-dialog
// data, login-bonus, deck-builder, story chapter-selection, room-match, socket.io)
// swept into the copy closure but never driven headless. Stubbed in their ORIGINAL
// namespaces so the copied engine resolves their type references. Enums are replicated
// VERBATIM from decomp (integer values can be cast); classes are empty until the loop
// demands a member.
using UnityEngine;
namespace Wizard.Dialog.Setting
{
// Real base of ItemButton/ItemToggle/... (copied). Abstract methods the copied
// subclasses override -- without this base they fall back to the unrelated
// Wizard.Item data class and CS0115 ("no method to override").
public abstract class Item : MonoBehaviour
{
public abstract void AddChangeCallback(EventDelegate.Callback callback);
public abstract void SetActive_SeparatorLine(bool isActive);
}
}
namespace Wizard.ErrorDialog
{
// Real Wizard.ErrorDialog.Data; without it Dialog.cs's unqualified `Data` falls
// back to the static Wizard.Data god-object (CS0718/0722/0723 + missing ButtonType).
public class Data
{
public enum ContactDisplayType { _NONE_, , MAX }
public enum ButtonType { _NONE_, OK, , , , , , , MAX }
public string TitleId { get; private set; }
public string BodyId { get; private set; }
public bool IsDisplayContact { get; private set; }
public ButtonType MainButton { get; private set; }
public ButtonType SubButton { get; private set; }
public int PanelDepth { get; private set; }
public Data(string id, string titleId, string bodyId, string contactDisplay,
string mainButton, string subButton, string panelDepth) { }
}
}
namespace Wizard.Battle.UI
{
public enum CantAttackType { Null, All, Class, NotHasGuard, Unit, Max }
}
namespace Wizard.Battle.View
{
// Decomp bases (dropped by the hand stub): both derive from BattleCardView, which
// carries the IBattleCardView impl — so they convert to IBattleCardView via it.
// The decomp ClassBattleCardViewBase also implements IClassBattleCardView; the resolution
// path casts the created view to it (ClassBattleCardBase.Setup), so re-attach the dropped
// interface here with no-op members (the leaf PlayerClassBattleCardView inherits them).
public abstract class ClassBattleCardViewBase : BattleCardView, IClassBattleCardView
{
public virtual Wizard.Battle.Player.ClassCharacter.IClassCharacter ClassCharacter => null;
public virtual void StartOutFrame() { }
public virtual void StartIntoFrame() { }
public virtual float GetCurrentClipTime() => 0f;
public virtual bool GetCurrentClipIsName(global::ClassCharaPrm.MotionType motionType) => false;
public virtual void ClearSpineObject() { }
}
public class NullBattleCardView : BattleCardView { public NullBattleCardView() { } public NullBattleCardView(BuildInfo buildInfo) { } public static void ReleaseSharedDummy() { } }
}
namespace Wizard.Battle.View.Vfx
{
// Base of the copied PuzzleBattleManager.PuzzleOpeningVfx (ctor + abstract override).
public abstract partial class OpeningVfx : SequentialVfxPlayer
{
protected OpeningVfx(BackGroundBase backGround) { }
public abstract void RegisterOpeningVfx(ClassBattleCardBase playerClass, ClassBattleCardBase enemyClass);
public static string OpenningLogStep = "";
public static VfxBase ShowBattleUIImmediatelyVfx(BattlePlayerBase battlePlayerBase, bool fixDirection = false, bool isNewReplay = false, bool isBanmenkun = false) => NullVfx.GetInstance();
public class WaitVoiceEndVfx : VfxBase { }
public class OpeningShowCharacterPanelVfx : SequentialVfxPlayer { }
}
}
namespace AnimationOrTween
{
public enum DisableCondition { DisableAfterReverse = -1, DoNotDisable, DisableAfterForward }
public enum EnableCondition { DoNothing, EnableThenPlay, IgnoreDisabledState }
}
namespace Wizard.UI.LoginBonus
{
public class ContinuousData { public ContinuousData(LitJson.JsonData jsonData) { } }
public class NormalData { public NormalData(LitJson.JsonData jsonData) { } }
public class SpecialData { public SpecialData(LitJson.JsonData jsonData) { } }
public class FreeCardPackBoxData { public FreeCardPackBoxData(LitJson.JsonData jsonData) { } }
}
namespace DeckBuilder
{
public partial class GenerateDeckCode { }
public partial class GetDeckDataFromCode { }
}
namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult
{
public interface IProcessing
{
IProcessing NextProcessing { get; set; }
void Execute(Parameter param);
}
// Parameter is generated full-surface (ctor + props) in Shim/Generated/Parameter__*.g.cs
}
namespace Wizard.RoomMatch
{
public partial class PlayerControllerForWatching { } // SEND_PARAMETER enum is in Generated/PlayerControllerForWatching.g.cs
public partial class RoomRuleSetting { }
}
namespace Cute
{
public class SceneChangeParameter { public bool KeepAssets; public SceneType BeforeScene; public SceneType NextScene; public string NextState; }
public class SceneManager
{
public SceneChangeParameter SceneChangeParameter = new SceneChangeParameter();
public void ChangeScene(string next_scene) { }
public void ChangeScene(string next_scene, string active_state) { }
public void ChangeScene(SceneType type, string active_state = "") { }
}
}
namespace Wizard.Story
{
public enum StoryApiType { None, MainStory, LimitedStory, EventStory }
public partial class SelectedStoryInfo { }
public partial class StoryWorldDataManager { }
public sealed class StoryWorldData { } // signature-only type pulled by StoryWorldDataManager full-surface (non-battle)
}
namespace Wizard.Title
{
// ITitleProc impls pulled by full-surface stubs; referenced as signature types only (non-battle).
public class BattleRecovery { }
public class ResourceDownloader { }
public class TemporaryAssetDeleter { }
}
namespace BestHTTP.SocketIO
{
// BestHTTP SDK types — minimal hand shim (full-surface would pull the whole SocketIO
// closure). Node-server real-time socket path is Phase-2; these are off the battle path.
public sealed class Packet { public System.Collections.Generic.List<byte[]> Attachments { get; set; } }
public delegate void SocketIOCallback(Socket socket, Packet packet, params object[] args);
public sealed class Socket
{
public string Id => "";
public Socket On(string eventName, SocketIOCallback callback) => this;
public Socket On(BestHTTP.SocketIO.SocketIOEventTypes type, SocketIOCallback callback) => this;
public Socket Off(string eventName) => this;
public Socket Off() => this;
public Socket Emit(string eventName, params object[] args) => this;
}
public class SocketOptions
{
public bool AutoConnect { get; set; }
public Transports.TransportTypes ConnectWith { get; set; }
public PlatformSupport.Collections.ObjectModel.ObservableDictionary<string, string> AdditionalQueryParams { get; set; }
}
public sealed class SocketManager
{
public enum States { Initial, Opening, Open, Paused, Pausing, Reconnecting, Closed }
public SocketManager(System.Uri uri) { }
public SocketManager(System.Uri uri, SocketOptions options) { }
public States State => States.Closed;
public Socket Socket { get; } = new Socket();
public Socket this[string nsp] => Socket;
public void Open() { }
public void Close() { }
public void SettingRealtimeNetworkAgent(object agent) { }
}
}
// ---- namespace anchors (referenced via `using`/qualified path; no type used yet) ----
namespace Wizard.Scripts.Network.Task { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Task.Arena { internal class _ShimAnchor { } }
namespace Wizard.Scripts.Network.Task.Arena.TwoPick { internal class _ShimAnchor { } }
namespace BestHTTP.Decompression.Zlib { internal class _ShimAnchor { } }