using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using Goap.Agent.Core; using Goap.Runtime; using UnityEngine; 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; using UnityFusion.CLRBinding.Adapter; #if DEBUG && !DISABLE_UNITYFUSION_DEBUG using AutoList = System.Collections.Generic.List; #else using AutoList = UnityFusion.Other.UncheckedList; #endif namespace UnityFusion.Runtime.Generated { unsafe class Goap_Runtime_CapabilityBuilder_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(Goap.Runtime.CapabilityBuilder); args = new Type[] { }; method = type.GetMethod("Build", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Build_0); 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(GoalBaseAdapter.Adapter)}; if (genericMethods.TryGetValue("AddGoal", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(Goap.Runtime.GoalBuilder))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, AddGoal_1); break; } } } args = new Type[] {typeof(GoapActionBaseAdapter.Adapter)}; if (genericMethods.TryGetValue("AddAction", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(ActionBuilder))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, AddAction_2); break; } } } args = new Type[] {typeof(LocalTargetSensorBaseAdapter.Adapter)}; if (genericMethods.TryGetValue("AddTargetSensor", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(TargetSensorBuilder))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, AddTargetSensor_3); break; } } } args = new Type[] {typeof(LocalWorldSensorBaseAdapter.Adapter)}; if (genericMethods.TryGetValue("AddWorldSensor", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(WorldSensorBuilder< LocalWorldSensorBaseAdapter.Adapter>))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, AddWorldSensor_4); break; } } } args = new Type[] {typeof(MultiSensorBaseAdapter.Adapter)}; if (genericMethods.TryGetValue("AddMultiSensor", out lst)) { foreach (var m in lst) { if (m.MatchGenericParameters(args, typeof(MultiSensorBuilder< MultiSensorBaseAdapter.Adapter>))) { method = m.MakeGenericMethod(args); app.RegisterCLRMethodRedirection(method, AddMultiSensor_5); break; } } } args = new Type[] {typeof(System.Type)}; method = type.GetMethod("AddAction", flag, null, args, null); app.RegisterCLRMethodRedirection(method, AddAction_1); args = new Type[] {typeof(System.String)}; method = type.GetConstructor(flag, null, args, null); app.RegisterCLRMethodRedirection(method, Ctor_0); } static StackObject* Build_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); Goap.Runtime.CapabilityBuilder instance_of_this_method = (Goap.Runtime.CapabilityBuilder) typeof(Goap.Runtime.CapabilityBuilder).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.Build(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* AddGoal_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); Goap.Runtime.CapabilityBuilder instance_of_this_method = (Goap.Runtime.CapabilityBuilder) typeof(Goap.Runtime.CapabilityBuilder).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.AddGoal(__method.GenericArguments.First().ReflectionType); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* AddAction_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.Type @_type = (System.Type) typeof(System.Type).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); Goap.Runtime.CapabilityBuilder instance_of_this_method = (Goap.Runtime.CapabilityBuilder) typeof(Goap.Runtime.CapabilityBuilder).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.AddAction(@_type); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* AddAction_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, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Goap.Runtime.CapabilityBuilder instance_of_this_method = (Goap.Runtime.CapabilityBuilder) typeof(Goap.Runtime.CapabilityBuilder).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.AddAction(__method.GenericArguments.First().ReflectionType); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* AddTargetSensor_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); Goap.Runtime.CapabilityBuilder instance_of_this_method = (Goap.Runtime.CapabilityBuilder) typeof(Goap.Runtime.CapabilityBuilder).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.AddTargetSensor(__method.GenericArguments.First().ReflectionType); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* AddWorldSensor_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); Goap.Runtime.CapabilityBuilder instance_of_this_method = (Goap.Runtime.CapabilityBuilder) typeof(Goap.Runtime.CapabilityBuilder).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 .AddWorldSensor(__method.GenericArguments.First().ReflectionType); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* AddMultiSensor_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); Goap.Runtime.CapabilityBuilder instance_of_this_method = (Goap.Runtime.CapabilityBuilder) typeof(Goap.Runtime.CapabilityBuilder).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 .AddMultiSensor(__method.GenericArguments.First().ReflectionType); 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.String @name = (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); var result_of_this_method = new Goap.Runtime.CapabilityBuilder(@name); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } } }