using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; using UnityFusion.CLR.TypeSystem; using UnityFusion.CLR.Method; using UnityFusion.Runtime.Enviorment; using UnityFusion.Runtime.Intepreter; using UnityFusion.Runtime.Stack; using UnityFusion.Reflection; using UnityFusion.CLR.Utils; #if DEBUG && !DISABLE_UNITYFUSION_DEBUG using AutoList = System.Collections.Generic.List; #else using AutoList = UnityFusion.Other.UncheckedList; #endif namespace UnityFusion.Runtime.Generated { unsafe class Fusion_Addons_KCC_KCCResolver_Binding { public static void Register(UnityFusion.Runtime.Enviorment.AppDomain app) { BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; MethodBase method; Type[] args; Type type = typeof(Fusion.Addons.KCC.KCCResolver); args = new Type[]{}; method = type.GetMethod("get_Count", flag, null, args, null); app.RegisterCLRMethodRedirection(method, get_Count_0); args = new Type[]{}; method = type.GetMethod("Reset", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Reset_1); args = new Type[]{typeof(UnityEngine.Vector3), typeof(System.Single)}; method = type.GetMethod("AddCorrection", flag, null, args, null); app.RegisterCLRMethodRedirection(method, AddCorrection_2); args = new Type[]{typeof(System.Int32)}; method = type.GetMethod("GetCorrection", flag, null, args, null); app.RegisterCLRMethodRedirection(method, GetCorrection_3); args = new Type[]{typeof(System.Int32), typeof(UnityEngine.Vector3).MakeByRefType()}; method = type.GetMethod("GetCorrection", flag, null, args, null); app.RegisterCLRMethodRedirection(method, GetCorrection_4); args = new Type[]{typeof(System.Int32), typeof(UnityEngine.Vector3).MakeByRefType(), typeof(System.Single).MakeByRefType()}; method = type.GetMethod("GetCorrection", flag, null, args, null); app.RegisterCLRMethodRedirection(method, GetCorrection_5); args = new Type[]{typeof(System.Int32), typeof(System.Single)}; method = type.GetMethod("CalculateBest", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CalculateBest_6); args = new Type[]{}; method = type.GetMethod("CalculateMinMax", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CalculateMinMax_7); args = new Type[]{}; method = type.GetMethod("CalculateSum", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CalculateSum_8); args = new Type[]{}; method = type.GetMethod("CalculateAverage", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CalculateAverage_9); args = new Type[]{}; method = type.GetMethod("CalculateBinary", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CalculateBinary_10); args = new Type[]{typeof(System.Int32), typeof(System.Single)}; method = type.GetMethod("CalculateErrorDescent", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CalculateErrorDescent_11); args = new Type[]{typeof(System.Int32), typeof(System.Single)}; method = type.GetMethod("CalculateGradientDescent", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CalculateGradientDescent_12); app.RegisterCLRCreateArrayInstance(type, s => new Fusion.Addons.KCC.KCCResolver[s]); args = new Type[]{typeof(System.Int32)}; method = type.GetConstructor(flag, null, args, null); app.RegisterCLRMethodRedirection(method, Ctor_0); } static StackObject* get_Count_0(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.Count; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* Reset_1(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); instance_of_this_method.Reset(); return __ret; } static StackObject* AddCorrection_2(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Single @distance = *(float*)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.Vector3 @direction = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); instance_of_this_method.AddCorrection(@direction, @distance); return __ret; } static StackObject* GetCorrection_3(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @index = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.GetCorrection(@index); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* GetCorrection_4(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Vector3 @direction = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack), (CLR.Utils.Extensions.TypeFlags)16); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 @index = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); var result_of_this_method = instance_of_this_method.GetCorrection(@index, out @direction); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @direction; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @direction; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @direction); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @direction; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @direction); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Vector3[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @direction; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); __intp.Free(ptr_of_this_method); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* GetCorrection_5(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Single @distance = __intp.RetriveFloat(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.Vector3 @direction = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack), (CLR.Utils.Extensions.TypeFlags)16); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Int32 @index = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 4); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); var result_of_this_method = instance_of_this_method.GetCorrection(@index, out @direction, out @distance); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Float; *(float*)&___dst->Value = @distance; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @distance; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @distance); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @distance; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @distance); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Single[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @distance; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @direction; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @direction; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @direction); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @direction; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @direction); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Vector3[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @direction; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); __intp.Free(ptr_of_this_method); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* CalculateBest_6(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Single @maxError = *(float*)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 @maxIterations = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.CalculateBest(@maxIterations, @maxError); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* CalculateMinMax_7(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.CalculateMinMax(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* CalculateSum_8(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.CalculateSum(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* CalculateAverage_9(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.CalculateAverage(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* CalculateBinary_10(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.CalculateBinary(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* CalculateErrorDescent_11(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Single @maxError = *(float*)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 @maxIterations = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.CalculateErrorDescent(@maxIterations, @maxError); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* CalculateGradientDescent_12(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Single @maxError = *(float*)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 @maxIterations = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.Addons.KCC.KCCResolver instance_of_this_method = (Fusion.Addons.KCC.KCCResolver)typeof(Fusion.Addons.KCC.KCCResolver).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.CalculateGradientDescent(@maxIterations, @maxError); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @maxSize = ptr_of_this_method->Value; var result_of_this_method = new Fusion.Addons.KCC.KCCResolver(@maxSize); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } } }