diff --git a/SVSim.BattleEngine/Shim/External/LooseEnds.cs b/SVSim.BattleEngine/Shim/External/LooseEnds.cs index c916c45..ce3e559 100644 --- a/SVSim.BattleEngine/Shim/External/LooseEnds.cs +++ b/SVSim.BattleEngine/Shim/External/LooseEnds.cs @@ -100,7 +100,20 @@ namespace AOT public MonoPInvokeCallbackAttribute(System.Type type) { } } } -namespace SFB { internal class _ShimAnchor { } } +namespace SFB +{ + public struct ExtensionFilter + { + public string Name; + public string[] Extensions; + public ExtensionFilter(string name, params string[] extensions) { Name = name; Extensions = extensions; } + } + public static class StandaloneFileBrowser + { + public static string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) => System.Array.Empty(); + public static string[] OpenFilePanel(string title, string directory, string extension, bool multiselect) => System.Array.Empty(); + } +} // ---- third-party SDK namespace anchors (referenced via `using`) ---- namespace Facebook { internal class _ShimAnchor { } } @@ -121,6 +134,31 @@ namespace Facebook.Unity } } namespace RedShellSDK { internal class _ShimAnchor { } } -namespace ZXing { internal class _ShimAnchor { } } -namespace ZXing.QrCode { internal class _ShimAnchor { } } -namespace ZXing.QrCode.Internal { internal class _ShimAnchor { } } +namespace ZXing +{ + public enum BarcodeFormat { QR_CODE, AZTEC, CODE_128, EAN_13 } + public sealed class Result { public string Text => ""; } + public class BarcodeWriter + { + public BarcodeFormat Format { get; set; } + public ZXing.QrCode.QrCodeEncodingOptions Options { get; set; } + public UnityEngine.Color32[] Write(string contents) => System.Array.Empty(); + } + public class BarcodeReader + { + public bool AutoRotate { get; set; } + public bool TryHarder { get; set; } + public Result Decode(UnityEngine.Color32[] rawColor, int width, int height) => null; + } +} +namespace ZXing.QrCode +{ + public class QrCodeEncodingOptions + { + public ZXing.QrCode.Internal.ErrorCorrectionLevel ErrorCorrection { get; set; } + public int Width { get; set; } + public int Height { get; set; } + public int Margin { get; set; } + } +} +namespace ZXing.QrCode.Internal { public enum ErrorCorrectionLevel { L, M, Q, H } } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs index 6a024b7..1f603d7 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs @@ -43,7 +43,7 @@ namespace UnityEngine public static Rect MinMaxRect(float xmin, float ymin, float xmax, float ymax) => new Rect(xmin, ymin, xmax - xmin, ymax - ymin); } public struct Matrix4x4 { public static Matrix4x4 identity => new Matrix4x4(); public Vector3 MultiplyPoint(Vector3 p) => p; public Vector3 MultiplyPoint3x4(Vector3 p) => p; public Vector3 MultiplyVector(Vector3 v) => v; public static Matrix4x4 TRS(Vector3 t, Quaternion r, Vector3 s) => identity; public Matrix4x4 inverse => identity; } - public struct Plane { public Plane(Vector3 normal, Vector3 point) { } public bool Raycast(Ray r, out float enter) { enter = 0; return false; } } + public struct Plane { public Plane(Vector3 normal, Vector3 point) { } public Plane(Vector3 a, Vector3 b, Vector3 c) { } public bool Raycast(Ray r, out float enter) { enter = 0; return false; } } public struct Ray { public Ray(Vector3 origin, Vector3 dir) { this.origin = origin; this.direction = dir; } public Vector3 origin; public Vector3 direction; public Vector3 GetPoint(float d) => origin; } public struct RaycastHit { public Vector3 point; public Vector3 normal; public float distance; public Collider collider; public Transform transform; public GameObject gameObject; } public struct RaycastHit2D { public Vector3 point; public Vector3 normal; public float distance; public Collider2D collider; public Transform transform; public static implicit operator bool(RaycastHit2D hit) => hit.collider != null; } @@ -281,11 +281,11 @@ namespace UnityEngine } public partial class Mesh : Object { public Vector3[] vertices { get; set; } public int[] triangles { get; set; } public void Clear() { } public void RecalculateBounds() { } } public class Texture : Object { public int width => 0; public int height => 0; } - public partial class Texture2D : Texture { public Texture2D(int w, int h) { } public void Apply() { } public Color GetPixel(int x, int y) => Color.white; public void SetPixel(int x, int y, Color c) { } } + public partial class Texture2D : Texture { public Texture2D(int w, int h) { } public Texture2D(int w, int h, TextureFormat format, bool mipChain) { } public void Apply() { } public Color GetPixel(int x, int y) => Color.white; public void SetPixel(int x, int y, Color c) { } } public enum FilterMode { Point, Bilinear, Trilinear } public enum TextureWrapMode { Repeat, Clamp, Mirror, MirrorOnce } public enum WrapMode { Once = 1, Loop = 2, PingPong = 4, Default = 0, ClampForever = 8, Clamp = 1 } - public struct Keyframe { public float time; public float value; public Keyframe(float t, float v) { time = t; value = v; } } + public struct Keyframe { public float time; public float value; public float inTangent; public float outTangent; public Keyframe(float t, float v) { time = t; value = v; inTangent = 0; outTangent = 0; } public Keyframe(float t, float v, float inT, float outT) { time = t; value = v; inTangent = inT; outTangent = outT; } } public struct AnimatorStateInfo { public bool IsName(string name) => false; public float normalizedTime => 0f; public int shortNameHash => 0; public float length => 0f; } public struct AnimatorClipInfo { public AnimationClip clip => null; public float weight => 0f; } public class RenderTexture : Texture { public RenderTexture(int w, int h, int depth) { } public RenderTexture(int w, int h, int depth, RenderTextureFormat fmt) { } public void Create() { } public void Release() { } public bool IsCreated() => false; public static RenderTexture active { get; set; } public int depth { get; set; } public FilterMode filterMode { get; set; } public TextureWrapMode wrapMode { get; set; } public void DiscardContents() { } public static RenderTexture GetTemporary(int w, int h) => null; public static RenderTexture GetTemporary(int w, int h, int depth) => null; public static RenderTexture GetTemporary(int w, int h, int depth, RenderTextureFormat fmt) => null; public static void ReleaseTemporary(RenderTexture rt) { } } @@ -309,7 +309,7 @@ namespace UnityEngine public AnimatorStateInfo GetCurrentAnimatorStateInfo(int layer) => default; public AnimatorClipInfo[] GetCurrentAnimatorClipInfo(int layer) => new AnimatorClipInfo[0]; } - public class AnimationCurve { public float Evaluate(float t) => 0f; public int length => 0; public Keyframe[] keys { get; set; } public WrapMode preWrapMode { get; set; } public WrapMode postWrapMode { get; set; } public static AnimationCurve Linear(float a, float b, float c, float d) => new AnimationCurve(); } + public class AnimationCurve { public AnimationCurve() { } public AnimationCurve(params Keyframe[] keys) { } public float Evaluate(float t) => 0f; public int length => 0; public Keyframe[] keys { get; set; } public WrapMode preWrapMode { get; set; } public WrapMode postWrapMode { get; set; } public static AnimationCurve Linear(float a, float b, float c, float d) => new AnimationCurve(); } public class AudioClip : Object { public float length => 0f; } public partial class AudioSource : Component { public AudioClip clip { get; set; } public float volume { get; set; } public bool isPlaying => false; public bool loop { get; set; } public void Play() { } public void Stop() { } public void Pause() { } } public partial class Camera : Component @@ -370,7 +370,7 @@ namespace UnityEngine public class ExecuteAlwaysAttribute : Attribute { } public class DisallowMultipleComponentAttribute : Attribute { } public class AndroidJavaObject : IDisposable { public AndroidJavaObject(string className, params object[] args) { } public T Call(string method, params object[] args) => default; public void Call(string method, params object[] args) { } public T Get(string name) => default; public void Set(string name, T val) { } public void Dispose() { } } - public class WebCamTexture : Texture { public WebCamTexture() { } public WebCamTexture(int w, int h, int fps) { } public void Play() { } public void Stop() { } public bool isPlaying => false; public Color32[] GetPixels32() => new Color32[0]; } + public class WebCamTexture : Texture { public WebCamTexture() { } public WebCamTexture(int w, int h, int fps) { } public WebCamTexture(string deviceName, int w, int h, int fps) { } public void Play() { } public void Stop() { } public bool isPlaying => false; public Color32[] GetPixels32() => new Color32[0]; public static WebCamDevice[] devices => System.Array.Empty(); } public class AddComponentMenu : Attribute { public AddComponentMenu(string n) { } public AddComponentMenu(string n, int o) { } } public class ContextMenu : Attribute { public ContextMenu(string n) { } } [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs index 5c06793..e0ebf8c 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs @@ -195,6 +195,8 @@ namespace UnityEngine.Networking { public partial class UnityWebRequest { + public UnityWebRequest() { } + public UnityWebRequest(string url, string method) { } public static string EscapeURL(string s) => s; public static UnityWebRequest Get(string uri) => new UnityWebRequest(); public UnityWebRequestAsyncOperation SendWebRequest() => new UnityWebRequestAsyncOperation(); @@ -215,3 +217,15 @@ namespace UnityEngine.Networking public class DownloadHandlerBuffer : DownloadHandler { } public class UnityWebRequestAsyncOperation : AsyncOperation { } } + +namespace UnityEngine +{ + // ---- additional off-battle-path Unity type stubs (CS0246 closure) ---- + public sealed class WaitForSecondsRealtime : YieldInstruction { public WaitForSecondsRealtime(float time) { } } + public enum AnimationBlendMode { Blend, Additive } + public class AnimationState { public string name { get; set; } public float speed { get; set; } public float time { get; set; } public float normalizedTime { get; set; } public float length => 0f; public float weight { get; set; } public bool enabled { get; set; } public WrapMode wrapMode { get; set; } public int layer { get; set; } public AnimationBlendMode blendMode { get; set; } public AnimationClip clip => null; } + public class GUIContent { public GUIContent() { } public GUIContent(string text) { } public string text { get; set; } public Texture image { get; set; } } + public class TextEditor { public GUIContent content { get; set; } public string text { get; set; } public void Copy() { } public void Paste() { } public void OnFocus() { } public void SelectAll() { } } + public struct WebCamDevice { public string name => ""; public bool isFrontFacing => false; } + public class Display { public int systemWidth => 0; public int systemHeight => 0; public int renderingWidth => 0; public int renderingHeight => 0; public static Display main => null; public static Display[] displays => Array.Empty(); } +} diff --git a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs index 320049a..1312f3a 100644 --- a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs +++ b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs @@ -49,7 +49,7 @@ 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. public abstract class ClassBattleCardViewBase : BattleCardView { } - public class NullBattleCardView : BattleCardView { public NullBattleCardView(BuildInfo buildInfo) { } public static void ReleaseSharedDummy() { } } + public class NullBattleCardView : BattleCardView { public NullBattleCardView() { } public NullBattleCardView(BuildInfo buildInfo) { } public static void ReleaseSharedDummy() { } } } namespace Wizard.Battle.View.Vfx