using System; using System.Collections.Generic; using System.Linq; 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 System_Double_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(System.Double); args = new Type[]{typeof(System.String)}; method = type.GetMethod("ToString", flag, null, args, null); app.RegisterCLRMethodRedirection(method, ToString_0); } static System.Double GetInstance(UnityFusion.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, AutoList __mStack) { ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); System.Double instance_of_this_method; switch(ptr_of_this_method->ObjectType) { case ObjectTypes.FieldReference: { var instance_of_fieldReference = __mStack[ptr_of_this_method->Value]; if(instance_of_fieldReference is ILTypeInstance) { instance_of_this_method = (System.Double)typeof(System.Double).CheckCLRTypes(((ILTypeInstance)instance_of_fieldReference)[ptr_of_this_method->ValueLow]); } else { var t = __domain.GetType(instance_of_fieldReference.GetType()) as CLRType; instance_of_this_method = (System.Double)t.GetFieldValue(ptr_of_this_method->ValueLow, instance_of_fieldReference); } } break; case ObjectTypes.StaticFieldReference: { var t = __domain.GetType(ptr_of_this_method->Value); if(t is ILType) { instance_of_this_method = (System.Double)typeof(System.Double).CheckCLRTypes(((ILType)t).StaticInstance[ptr_of_this_method->ValueLow]); } else { instance_of_this_method = (System.Double)((CLRType)t).GetFieldValue(ptr_of_this_method->ValueLow, null); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Double[]; instance_of_this_method = instance_of_arrayReference[ptr_of_this_method->ValueLow]; } break; default: instance_of_this_method = *(double*)&ptr_of_this_method->Value; break; } return instance_of_this_method; } static StackObject* ToString_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, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.String @format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Double instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.ToString(@format); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } } }