diff --git a/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs b/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs index 219ec0f..215cfdc 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs @@ -129,8 +129,12 @@ namespace UnityEngine public static int Abs(int f) => Math.Abs(f); public static float Max(float a, float b) => Math.Max(a, b); public static int Max(int a, int b) => Math.Max(a, b); + public static float Max(params float[] values) { float m = float.NegativeInfinity; foreach (var v in values) m = Math.Max(m, v); return m; } + public static int Max(params int[] values) { int m = int.MinValue; foreach (var v in values) m = Math.Max(m, v); return m; } public static float Min(float a, float b) => Math.Min(a, b); public static int Min(int a, int b) => Math.Min(a, b); + public static float Min(params float[] values) { float m = float.PositiveInfinity; foreach (var v in values) m = Math.Min(m, v); return m; } + public static int Min(params int[] values) { int m = int.MaxValue; foreach (var v in values) m = Math.Min(m, v); return m; } public static float Clamp(float v, float lo, float hi) => Math.Max(lo, Math.Min(hi, v)); public static int Clamp(int v, int lo, int hi) => Math.Max(lo, Math.Min(hi, v)); public static float Clamp01(float v) => Math.Max(0f, Math.Min(1f, v)); diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs index 5ff7fbd..6a024b7 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs @@ -63,10 +63,13 @@ namespace UnityEngine public static T Instantiate(T original) where T : Object => original; public static T Instantiate(T original, Transform parent) where T : Object => original; public static T Instantiate(T original, Vector3 pos, Quaternion rot) where T : Object => original; + public static T Instantiate(T original, Vector3 pos, Quaternion rot, Transform parent) where T : Object => original; public static Object Instantiate(Object original) => original; public static T FindObjectOfType() where T : Object => null; public static T[] FindObjectsOfType() where T : Object => new T[0]; + public static T[] FindObjectsOfType(bool includeInactive) where T : Object => new T[0]; public static Object FindObjectOfType(System.Type t) => null; + public static Object[] FindObjectsOfType(System.Type t) => new Object[0]; public static bool operator ==(Object a, Object b) => ReferenceEquals(a, b); public static bool operator !=(Object a, Object b) => !ReferenceEquals(a, b); public static implicit operator bool(Object o) => !ReferenceEquals(o, null); @@ -96,6 +99,8 @@ namespace UnityEngine public void SendMessage(string method, object value, SendMessageOptions options) { } public void SendMessage(string method, SendMessageOptions options) { } public void BroadcastMessage(string method) { } + public void BroadcastMessage(string method, object parameter) { } + public void BroadcastMessage(string method, object parameter, SendMessageOptions options) { } public bool CompareTag(string t) => false; } @@ -110,6 +115,7 @@ namespace UnityEngine public void StopAllCoroutines() { } public void Invoke(string methodName, float time) { } public void CancelInvoke() { } + public void CancelInvoke(string methodName) { } public bool IsInvoking() => false; } @@ -138,7 +144,9 @@ namespace UnityEngine public Vector3 right { get => Vector3.right; set { } } public Transform root => this; public Vector3 TransformPoint(Vector3 p) => p; + public Vector3 TransformPoint(float x, float y, float z) => new Vector3(x, y, z); public Vector3 InverseTransformPoint(Vector3 p) => p; + public Vector3 InverseTransformPoint(float x, float y, float z) => new Vector3(x, y, z); public Vector3 TransformDirection(Vector3 d) => d; public Vector3 InverseTransformDirection(Vector3 d) => d; public Vector3 TransformVector(Vector3 v) => v; @@ -149,7 +157,9 @@ namespace UnityEngine public void Rotate(float x, float y, float z) { } public void RotateAround(Vector3 point, Vector3 axis, float angle) { } public void LookAt(Transform t) { } + public void LookAt(Transform t, Vector3 worldUp) { } public void LookAt(Vector3 p) { } + public void LookAt(Vector3 p, Vector3 worldUp) { } public void DetachChildren() { } public Transform Find(string n, bool includeInactive) => null; public IEnumerator GetEnumerator() { yield break; } @@ -184,6 +194,8 @@ namespace UnityEngine public void SendMessage(string method, object value, SendMessageOptions options) { } public void SendMessage(string method, SendMessageOptions options) { } public void BroadcastMessage(string method) { } + public void BroadcastMessage(string method, object parameter) { } + public void BroadcastMessage(string method, object parameter, SendMessageOptions options) { } public bool CompareTag(string t) => false; public static GameObject Find(string n) => null; public static GameObject FindGameObjectWithTag(string t) => null; @@ -288,6 +300,8 @@ namespace UnityEngine public void SetFloat(string n, float v) { } public bool GetBool(string n) => false; public int GetInteger(string n) => 0; public float GetFloat(string n) => 0f; public void Play(string n) { } public void Play(int hash) { } + public void Play(string n, int layer) { } public void Play(string n, int layer, float normalizedTime) { } + public void Play(int hash, int layer) { } public void Play(int hash, int layer, float normalizedTime) { } public void SetLayerWeight(int layer, float w) { } public float speed { get; set; } public bool enabled { get; set; } public void ResetTrigger(string n) { } public void ResetTrigger(int id) { } diff --git a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs index bfda19c..320049a 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 static void ReleaseSharedDummy() { } } + public class NullBattleCardView : BattleCardView { public NullBattleCardView(BuildInfo buildInfo) { } public static void ReleaseSharedDummy() { } } } namespace Wizard.Battle.View.Vfx