ETModel_Entity_Binding.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Runtime.InteropServices;
  6. using ILRuntime.CLR.TypeSystem;
  7. using ILRuntime.CLR.Method;
  8. using ILRuntime.Runtime.Enviorment;
  9. using ILRuntime.Runtime.Intepreter;
  10. using ILRuntime.Runtime.Stack;
  11. using ILRuntime.Reflection;
  12. using ILRuntime.CLR.Utils;
  13. namespace ILRuntime.Runtime.Generated
  14. {
  15. unsafe class ETModel_Entity_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. MethodBase method;
  20. Type[] args;
  21. Type type = typeof(ETModel.Entity);
  22. Dictionary<string, List<MethodInfo>> genericMethods = new Dictionary<string, List<MethodInfo>>();
  23. List<MethodInfo> lst = null;
  24. foreach(var m in type.GetMethods())
  25. {
  26. if(m.IsGenericMethodDefinition)
  27. {
  28. if (!genericMethods.TryGetValue(m.Name, out lst))
  29. {
  30. lst = new List<MethodInfo>();
  31. genericMethods[m.Name] = lst;
  32. }
  33. lst.Add(m);
  34. }
  35. }
  36. args = new Type[]{typeof(ETModel.ResourcesComponent)};
  37. if (genericMethods.TryGetValue("GetComponent", out lst))
  38. {
  39. foreach(var m in lst)
  40. {
  41. if(m.GetParameters().Length == 0)
  42. {
  43. method = m.MakeGenericMethod(args);
  44. app.RegisterCLRMethodRedirection(method, GetComponent_0);
  45. break;
  46. }
  47. }
  48. }
  49. args = new Type[]{typeof(ETModel.UnitComponent)};
  50. if (genericMethods.TryGetValue("GetComponent", out lst))
  51. {
  52. foreach(var m in lst)
  53. {
  54. if(m.GetParameters().Length == 0)
  55. {
  56. method = m.MakeGenericMethod(args);
  57. app.RegisterCLRMethodRedirection(method, GetComponent_1);
  58. break;
  59. }
  60. }
  61. }
  62. args = new Type[]{typeof(ETModel.CameraComponent)};
  63. if (genericMethods.TryGetValue("GetComponent", out lst))
  64. {
  65. foreach(var m in lst)
  66. {
  67. if(m.GetParameters().Length == 0)
  68. {
  69. method = m.MakeGenericMethod(args);
  70. app.RegisterCLRMethodRedirection(method, GetComponent_2);
  71. break;
  72. }
  73. }
  74. }
  75. args = new Type[]{typeof(ETModel.MoveComponent)};
  76. if (genericMethods.TryGetValue("GetComponent", out lst))
  77. {
  78. foreach(var m in lst)
  79. {
  80. if(m.GetParameters().Length == 0)
  81. {
  82. method = m.MakeGenericMethod(args);
  83. app.RegisterCLRMethodRedirection(method, GetComponent_3);
  84. break;
  85. }
  86. }
  87. }
  88. args = new Type[]{typeof(ETModel.MessageDispatherComponent)};
  89. if (genericMethods.TryGetValue("GetComponent", out lst))
  90. {
  91. foreach(var m in lst)
  92. {
  93. if(m.GetParameters().Length == 0)
  94. {
  95. method = m.MakeGenericMethod(args);
  96. app.RegisterCLRMethodRedirection(method, GetComponent_4);
  97. break;
  98. }
  99. }
  100. }
  101. args = new Type[]{typeof(ETModel.OpcodeTypeComponent)};
  102. if (genericMethods.TryGetValue("GetComponent", out lst))
  103. {
  104. foreach(var m in lst)
  105. {
  106. if(m.GetParameters().Length == 0)
  107. {
  108. method = m.MakeGenericMethod(args);
  109. app.RegisterCLRMethodRedirection(method, GetComponent_5);
  110. break;
  111. }
  112. }
  113. }
  114. args = new Type[]{typeof(ETModel.SessionCallbackComponent)};
  115. if (genericMethods.TryGetValue("AddComponent", out lst))
  116. {
  117. foreach(var m in lst)
  118. {
  119. if(m.GetParameters().Length == 0)
  120. {
  121. method = m.MakeGenericMethod(args);
  122. app.RegisterCLRMethodRedirection(method, AddComponent_6);
  123. break;
  124. }
  125. }
  126. }
  127. args = new Type[]{typeof(ETModel.NetOuterComponent)};
  128. if (genericMethods.TryGetValue("GetComponent", out lst))
  129. {
  130. foreach(var m in lst)
  131. {
  132. if(m.GetParameters().Length == 0)
  133. {
  134. method = m.MakeGenericMethod(args);
  135. app.RegisterCLRMethodRedirection(method, GetComponent_7);
  136. break;
  137. }
  138. }
  139. }
  140. args = new Type[]{typeof(ETModel.SessionComponent)};
  141. if (genericMethods.TryGetValue("AddComponent", out lst))
  142. {
  143. foreach(var m in lst)
  144. {
  145. if(m.GetParameters().Length == 0)
  146. {
  147. method = m.MakeGenericMethod(args);
  148. app.RegisterCLRMethodRedirection(method, AddComponent_8);
  149. break;
  150. }
  151. }
  152. }
  153. args = new Type[]{typeof(ETModel.PlayerComponent)};
  154. if (genericMethods.TryGetValue("GetComponent", out lst))
  155. {
  156. foreach(var m in lst)
  157. {
  158. if(m.GetParameters().Length == 0)
  159. {
  160. method = m.MakeGenericMethod(args);
  161. app.RegisterCLRMethodRedirection(method, GetComponent_9);
  162. break;
  163. }
  164. }
  165. }
  166. }
  167. static StackObject* GetComponent_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  168. {
  169. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  170. StackObject* ptr_of_this_method;
  171. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  172. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  173. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  174. __intp.Free(ptr_of_this_method);
  175. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.ResourcesComponent>();
  176. object obj_result_of_this_method = result_of_this_method;
  177. if(obj_result_of_this_method is CrossBindingAdaptorType)
  178. {
  179. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  180. }
  181. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  182. }
  183. static StackObject* GetComponent_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  184. {
  185. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  186. StackObject* ptr_of_this_method;
  187. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  188. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  189. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  190. __intp.Free(ptr_of_this_method);
  191. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.UnitComponent>();
  192. object obj_result_of_this_method = result_of_this_method;
  193. if(obj_result_of_this_method is CrossBindingAdaptorType)
  194. {
  195. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  196. }
  197. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  198. }
  199. static StackObject* GetComponent_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  200. {
  201. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  202. StackObject* ptr_of_this_method;
  203. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  204. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  205. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  206. __intp.Free(ptr_of_this_method);
  207. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.CameraComponent>();
  208. object obj_result_of_this_method = result_of_this_method;
  209. if(obj_result_of_this_method is CrossBindingAdaptorType)
  210. {
  211. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  212. }
  213. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  214. }
  215. static StackObject* GetComponent_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  216. {
  217. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  218. StackObject* ptr_of_this_method;
  219. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  220. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  221. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  222. __intp.Free(ptr_of_this_method);
  223. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.MoveComponent>();
  224. object obj_result_of_this_method = result_of_this_method;
  225. if(obj_result_of_this_method is CrossBindingAdaptorType)
  226. {
  227. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  228. }
  229. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  230. }
  231. static StackObject* GetComponent_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  232. {
  233. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  234. StackObject* ptr_of_this_method;
  235. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  236. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  237. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  238. __intp.Free(ptr_of_this_method);
  239. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.MessageDispatherComponent>();
  240. object obj_result_of_this_method = result_of_this_method;
  241. if(obj_result_of_this_method is CrossBindingAdaptorType)
  242. {
  243. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  244. }
  245. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  246. }
  247. static StackObject* GetComponent_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  248. {
  249. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  250. StackObject* ptr_of_this_method;
  251. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  252. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  253. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  254. __intp.Free(ptr_of_this_method);
  255. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.OpcodeTypeComponent>();
  256. object obj_result_of_this_method = result_of_this_method;
  257. if(obj_result_of_this_method is CrossBindingAdaptorType)
  258. {
  259. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  260. }
  261. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  262. }
  263. static StackObject* AddComponent_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  264. {
  265. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  266. StackObject* ptr_of_this_method;
  267. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  268. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  269. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  270. __intp.Free(ptr_of_this_method);
  271. var result_of_this_method = instance_of_this_method.AddComponent<ETModel.SessionCallbackComponent>();
  272. object obj_result_of_this_method = result_of_this_method;
  273. if(obj_result_of_this_method is CrossBindingAdaptorType)
  274. {
  275. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  276. }
  277. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  278. }
  279. static StackObject* GetComponent_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  280. {
  281. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  282. StackObject* ptr_of_this_method;
  283. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  284. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  285. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  286. __intp.Free(ptr_of_this_method);
  287. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.NetOuterComponent>();
  288. object obj_result_of_this_method = result_of_this_method;
  289. if(obj_result_of_this_method is CrossBindingAdaptorType)
  290. {
  291. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  292. }
  293. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  294. }
  295. static StackObject* AddComponent_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  296. {
  297. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  298. StackObject* ptr_of_this_method;
  299. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  300. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  301. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  302. __intp.Free(ptr_of_this_method);
  303. var result_of_this_method = instance_of_this_method.AddComponent<ETModel.SessionComponent>();
  304. object obj_result_of_this_method = result_of_this_method;
  305. if(obj_result_of_this_method is CrossBindingAdaptorType)
  306. {
  307. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  308. }
  309. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  310. }
  311. static StackObject* GetComponent_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  312. {
  313. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  314. StackObject* ptr_of_this_method;
  315. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  316. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  317. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  318. __intp.Free(ptr_of_this_method);
  319. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.PlayerComponent>();
  320. object obj_result_of_this_method = result_of_this_method;
  321. if(obj_result_of_this_method is CrossBindingAdaptorType)
  322. {
  323. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  324. }
  325. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  326. }
  327. }
  328. }