diff --git a/SVSim.BattleEngine/Shim/External/SdkStubs.cs b/SVSim.BattleEngine/Shim/External/SdkStubs.cs index bb9cb43..2dde9b1 100644 --- a/SVSim.BattleEngine/Shim/External/SdkStubs.cs +++ b/SVSim.BattleEngine/Shim/External/SdkStubs.cs @@ -99,3 +99,13 @@ namespace BestHTTP.Decompression.Zlib public static class TimeNativePlugin { public static float GetDeviceOperatingTime() => 0f; } public static class Packsize { public static bool Test() => true; } public static class DllCheck { public static bool Test() => true; } + +// The BCL's CollectionExtensions.GetValueOrDefault only binds to IReadOnlyDictionary; +// copied code calls it on an IDictionary<,> static type (where the only by-name match is +// the copied JsonDataExtension.GetValueOrDefault(JsonData,...) — wrong receiver). Supply the +// IDictionary form globally so the call resolves. +public static class ShimDictionaryExtensions +{ + public static TValue GetValueOrDefault(this System.Collections.Generic.IDictionary dict, TKey key, TValue defaultValue) + => dict != null && dict.TryGetValue(key, out var v) ? v : defaultValue; +} diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs index 4eb6baf..adc5f25 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs @@ -47,7 +47,7 @@ namespace UnityEngine public override int GetHashCode() => x.GetHashCode() ^ (y.GetHashCode() << 2) ^ (width.GetHashCode() << 4) ^ (height.GetHashCode() << 6); } 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 static Matrix4x4 operator *(Matrix4x4 a, Matrix4x4 b) => identity; public Vector4 GetColumn(int i) => default; public Vector4 GetRow(int i) => default; public float this[int row, int col] { get => 0f; set { } } } - 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 Plane { public Plane(Vector3 normal, Vector3 point) { } public Plane(Vector3 inNormal, float d) { } 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,6 +281,7 @@ namespace UnityEngine public void SetColor(string n, Color c) { } public void SetTexture(string n, Texture t) { } public void SetVector(string n, Vector4 v) { } + public void SetVector(int nameID, Vector4 v) { } public void SetMatrix(string n, Matrix4x4 m) { } public void SetTextureOffset(string n, Vector2 o) { } public void EnableKeyword(string k) { } diff --git a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs index eae52b5..cf39f97 100644 --- a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs +++ b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs @@ -142,6 +142,7 @@ namespace BestHTTP.SocketIO { 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;