From be104258194d4777c8fe3e838104852565df69b2 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Fri, 5 Jun 2026 23:18:35 -0400 Subject: [PATCH] feat(battle-engine): VfxWith ctor arg order + Unity conversions + ITouchProcessor reattach (1102->958) - VfxWith ctor params were swapped ((T,VfxBase) vs decomp (VfxBase,T)) -> ~38 CS1503 across SkillCollectionBase/BattleCardBase skill-processing (ProcessInfo <-> VfxBase). These are on the resolution path. Fixed to match decomp. - UnityEngine primitives: implicit Vector3/Vector2<->Vector4 + Color->Color32 conversions; Transform.Translate/Rotate(Vector3,Space) overloads (iTween). - ITouchProcessor was dropped from touch-processor stubs by base-clause recovery; re-attach via Shim/View/TouchProcessorIfaces.cs (interface-only for generated full-surface stubs, interface+no-op members for the empty hand stubs). Co-Authored-By: Claude Opus 4.8 --- .../Shim/UnityEngine/Primitives.cs | 3 + .../Shim/UnityEngine/UnityShimExt.cs | 7 ++ .../Shim/View/TouchProcessorIfaces.cs | 66 +++++++++++++++++++ SVSim.BattleEngine/Shim/View/VfxShim.cs | 2 +- .../Shim/View/ViewUiTouchStubs.cs | 12 ++-- 5 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs diff --git a/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs b/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs index 9a5ca30..219ec0f 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs @@ -106,6 +106,9 @@ namespace UnityEngine public static Color operator *(Color a, Color b) => new Color(a.r * b.r, a.g * b.g, a.b * b.b, a.a * b.a); public static Color operator +(Color a, Color b) => new Color(a.r + b.r, a.g + b.g, a.b + b.b, a.a + b.a); public static implicit operator Color(Color32 c) => new Color(c.r / 255f, c.g / 255f, c.b / 255f, c.a / 255f); + public static implicit operator Color32(Color c) => new Color32( + (byte)(Mathf.Clamp01(c.r) * 255f), (byte)(Mathf.Clamp01(c.g) * 255f), + (byte)(Mathf.Clamp01(c.b) * 255f), (byte)(Mathf.Clamp01(c.a) * 255f)); } public static class Mathf diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs index 89e89d2..5c06793 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs @@ -13,6 +13,11 @@ namespace UnityEngine public static Vector4 one => new Vector4(1f, 1f, 1f, 1f); public Vector4(float x, float y, float z) { this.x = x; this.y = y; this.z = z; this.w = 0f; } public Vector4(float x, float y) { this.x = x; this.y = y; this.z = 0f; this.w = 0f; } + // UnityEngine implicitly promotes/truncates between Vector2/3/4. + public static implicit operator Vector4(Vector3 v) => new Vector4(v.x, v.y, v.z, 0f); + public static implicit operator Vector3(Vector4 v) => new Vector3(v.x, v.y, v.z); + public static implicit operator Vector4(Vector2 v) => new Vector4(v.x, v.y, 0f, 0f); + public static implicit operator Vector2(Vector4 v) => new Vector2(v.x, v.y); } public partial class Transform @@ -22,6 +27,8 @@ namespace UnityEngine public Matrix4x4 worldToLocalMatrix => default; public void Translate(float x, float y) { } public void Rotate(float x, float y) { } + public void Translate(Vector3 translation, Space relativeTo) { } + public void Rotate(Vector3 eulers, Space relativeTo) { } } public partial class LODGroup diff --git a/SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs b/SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs new file mode 100644 index 0000000..60c0eff --- /dev/null +++ b/SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs @@ -0,0 +1,66 @@ +// AUTHORED SHIM (not copied). Re-attaches ITouchProcessor to the touch-processor +// stubs. m1_baseclauses.py drops interfaces from recovered base clauses (to avoid +// CS0535), but copied battle code converts these processors to ITouchProcessor +// (e.g. TouchProcessorStack pushes them). Touch input is not on the headless +// resolution path — these are compile-only ballast, so the members are no-ops. +using UnityEngine; +using Wizard.Battle.View.Vfx; + +namespace Wizard.Battle.Touch +{ + // Generated full-surface stubs already carry Start/Update/End/CheckIsEnd — + // only the dropped interface needs re-declaring. + public partial class CardTouchProcessorBase : ITouchProcessor { } + public partial class ChoiceTouchProcessor : ITouchProcessor { } + public partial class DeckTouchProcessor : ITouchProcessor { } + public partial class EvolutionTouchProcessor : ITouchProcessor { } + public partial class FusionSimpleProcessor : ITouchProcessor { } + public partial class FusionTargetSelectTouchProcessor : ITouchProcessor { } + public partial class SelectCardProcessor : ITouchProcessor { } + + // Empty hand stubs: supply the four ITouchProcessor members as no-ops. + public partial class SkillTargetSelectTouchProcessor : ITouchProcessor + { + public VfxBase Start() => NullVfx.GetInstance(); + public VfxBase Update(float dt, Camera camera) => NullVfx.GetInstance(); + public VfxWith End() => default!; + public bool CheckIsEnd() => default!; + } + public partial class SetCardProcessor : ITouchProcessor + { + public VfxBase Start() => NullVfx.GetInstance(); + public VfxBase Update(float dt, Camera camera) => NullVfx.GetInstance(); + public VfxWith End() => default!; + public bool CheckIsEnd() => default!; + } + public partial class EvolutionSimpleProcessor : ITouchProcessor + { + public VfxBase Start() => NullVfx.GetInstance(); + public VfxBase Update(float dt, Camera camera) => NullVfx.GetInstance(); + public VfxWith End() => default!; + public bool CheckIsEnd() => default!; + } + public partial class EmotionTouchProcessor : ITouchProcessor + { + public VfxBase Start() => NullVfx.GetInstance(); + public VfxBase Update(float dt, Camera camera) => NullVfx.GetInstance(); + public VfxWith End() => default!; + public bool CheckIsEnd() => default!; + } + public partial class ClassBuffTouchProcessor : ITouchProcessor + { + public VfxBase Start() => NullVfx.GetInstance(); + public VfxBase Update(float dt, Camera camera) => NullVfx.GetInstance(); + public VfxWith End() => default!; + public bool CheckIsEnd() => default!; + } + // Decomp: DetailPanelTouchProcessor : CardTouchProcessorBase; the hand stub omits + // the base, so supply the interface members directly like the other empty stubs. + public partial class DetailPanelTouchProcessor : ITouchProcessor + { + public VfxBase Start() => NullVfx.GetInstance(); + public VfxBase Update(float dt, Camera camera) => NullVfx.GetInstance(); + public VfxWith End() => default!; + public bool CheckIsEnd() => default!; + } +} diff --git a/SVSim.BattleEngine/Shim/View/VfxShim.cs b/SVSim.BattleEngine/Shim/View/VfxShim.cs index 02fa4cc..9f4023f 100644 --- a/SVSim.BattleEngine/Shim/View/VfxShim.cs +++ b/SVSim.BattleEngine/Shim/View/VfxShim.cs @@ -103,7 +103,7 @@ namespace Wizard.Battle.View.Vfx { public T Value { get; set; } public VfxWith() { } - public VfxWith(T value, VfxBase vfx) { Value = value; Vfx = vfx; } + public VfxWith(VfxBase vfx, T value) { Vfx = vfx; Value = value; } } // Two-value pair (engine reads .Value_1 / .Value_2 / .Vfx). diff --git a/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs b/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs index 01be934..2198588 100644 --- a/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs +++ b/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs @@ -39,13 +39,13 @@ namespace Wizard.Battle.UI namespace Wizard.Battle.Touch { - public class SkillTargetSelectTouchProcessor { } + public partial class SkillTargetSelectTouchProcessor { } public partial class EvolutionTouchProcessor { } - public class SetCardProcessor { } - public class EvolutionSimpleProcessor { } - public class EmotionTouchProcessor { } - public class DetailPanelTouchProcessor { } - public class ClassBuffTouchProcessor { } + public partial class SetCardProcessor { } + public partial class EvolutionSimpleProcessor { } + public partial class EmotionTouchProcessor { } + public partial class DetailPanelTouchProcessor { } + public partial class ClassBuffTouchProcessor { } } namespace Wizard.Battle.Replay