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_Linq_Enumerable_Binding { public static void Register(UnityFusion.Runtime.Enviorment.AppDomain app) { MethodBase method; Type[] args; Type type = typeof(System.Linq.Enumerable); Dictionary> genericMethods = new Dictionary>(); List lst = null; foreach (var m in type.GetMethods()) { if (m.IsGenericMethodDefinition) { if (!genericMethods.TryGetValue(m.Name, out lst)) { lst = new List(); genericMethods[m.Name] = lst; } lst.Add(m); } } args = new Type[] {typeof(UnityEngine.Material)}; if (genericMethods.TryGetValue("ToList", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(System.Collections.Generic.List), typeof(System.Collections.Generic.IEnumerable))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, ToList_0); break; } } } args = new Type[] { typeof(UnityEngine.Vector3), typeof(System.Collections.Generic.KeyValuePair) }; if (genericMethods.TryGetValue("Select", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(System.Collections.Generic.IEnumerable>), typeof(System.Collections.Generic.IEnumerable), typeof(System.Func>))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, Select_1); break; } } } args = new Type[] { typeof(System.Collections.Generic.KeyValuePair), typeof(UnityEngine.Vector3) }; if (genericMethods.TryGetValue("GroupBy", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(System.Collections.Generic.IEnumerable>>), typeof(System.Collections.Generic.IEnumerable>), typeof(System.Func< System.Collections.Generic.KeyValuePair, UnityEngine.Vector3>))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, GroupBy_2); break; } } } args = new Type[] {typeof(System.String)}; if (genericMethods.TryGetValue("ToArray", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(System.String[]), typeof(System.Collections.Generic.IEnumerable))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, ToArray_0); break; } } } args = new Type[] {typeof(UnityFusion.Runtime.Intepreter.ILTypeInstance)}; if (genericMethods.TryGetValue("ToArray", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(UnityFusion.Runtime.Intepreter.ILTypeInstance[]), typeof( System.Collections.Generic.IEnumerable))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, ToArray_4); break; } } } args = new Type[] {typeof(UnityFusion.Runtime.Intepreter.ILTypeInstance)}; if (genericMethods.TryGetValue("First", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(UnityFusion.Runtime.Intepreter.ILTypeInstance), typeof( System.Collections.Generic.IEnumerable))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, First_5); break; } } } args = new Type[] {typeof(System.Collections.Generic.KeyValuePair)}; if (genericMethods.TryGetValue("Count", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(System.Int32), typeof(System.Collections.Generic.IEnumerable>))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, Count_3); break; } } } } static StackObject* ToArray_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.Collections.Generic.IEnumerable @source = (System.Collections.Generic.IEnumerable) typeof(System.Collections.Generic.IEnumerable).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 = System.Linq.Enumerable.ToArray(@source); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* ToArray_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, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Collections.Generic.IEnumerable @source = (System.Collections.Generic.IEnumerable) typeof(System.Collections.Generic.IEnumerable) .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 = System.Linq.Enumerable.ToArray(@source); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* First_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, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Collections.Generic.IEnumerable @source = (System.Collections.Generic.IEnumerable) typeof(System.Collections.Generic.IEnumerable) .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 = System.Linq.Enumerable.First(@source); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* ToList_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.Collections.Generic.IEnumerable @source = (System.Collections.Generic.IEnumerable) typeof(System.Collections.Generic.IEnumerable).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 = System.Linq.Enumerable.ToList(@source); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* Select_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, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Func> @selector = (System.Func>) typeof(System.Func>).CheckCLRTypes( StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 8); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Collections.Generic.IEnumerable @source = (System.Collections.Generic.IEnumerable) typeof(System.Collections.Generic.IEnumerable).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 = System.Linq.Enumerable .Select>(@source, @selector); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* GroupBy_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, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Func, UnityEngine.Vector3> @keySelector = (System.Func, UnityEngine.Vector3>) typeof(System.Func, UnityEngine.Vector3>) .CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 8); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Collections.Generic.IEnumerable< System.Collections.Generic.KeyValuePair> @source = (System.Collections.Generic.IEnumerable< System.Collections.Generic.KeyValuePair>) typeof(System.Collections.Generic.IEnumerable< System.Collections.Generic.KeyValuePair>).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 = System.Linq.Enumerable .GroupBy, UnityEngine.Vector3>(@source, @keySelector); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* Count_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, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Collections.Generic.IEnumerable< System.Collections.Generic.KeyValuePair> @source = (System.Collections.Generic.IEnumerable< System.Collections.Generic.KeyValuePair>) typeof(System.Collections.Generic.IEnumerable< System.Collections.Generic.KeyValuePair>).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 = System.Linq.Enumerable .Count>(@source); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } } }