ETModel_Entity_Binding.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  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.MatchGenericParameters(args, typeof(ETModel.ResourcesComponent)))
  42. {
  43. method = m.MakeGenericMethod(args);
  44. app.RegisterCLRMethodRedirection(method, GetComponent_0);
  45. break;
  46. }
  47. }
  48. }
  49. args = new Type[]{typeof(ETModel.NetOuterComponent)};
  50. if (genericMethods.TryGetValue("GetComponent", out lst))
  51. {
  52. foreach(var m in lst)
  53. {
  54. if(m.MatchGenericParameters(args, typeof(ETModel.NetOuterComponent)))
  55. {
  56. method = m.MakeGenericMethod(args);
  57. app.RegisterCLRMethodRedirection(method, GetComponent_1);
  58. break;
  59. }
  60. }
  61. }
  62. args = new Type[]{typeof(ETModel.SessionComponent)};
  63. if (genericMethods.TryGetValue("AddComponent", out lst))
  64. {
  65. foreach(var m in lst)
  66. {
  67. if(m.MatchGenericParameters(args, typeof(ETModel.SessionComponent)))
  68. {
  69. method = m.MakeGenericMethod(args);
  70. app.RegisterCLRMethodRedirection(method, AddComponent_2);
  71. break;
  72. }
  73. }
  74. }
  75. args = new Type[]{typeof(ETModel.PlayerComponent)};
  76. if (genericMethods.TryGetValue("GetComponent", out lst))
  77. {
  78. foreach(var m in lst)
  79. {
  80. if(m.MatchGenericParameters(args, typeof(ETModel.PlayerComponent)))
  81. {
  82. method = m.MakeGenericMethod(args);
  83. app.RegisterCLRMethodRedirection(method, GetComponent_3);
  84. break;
  85. }
  86. }
  87. }
  88. args = new Type[]{typeof(ETModel.SceneChangeComponent)};
  89. if (genericMethods.TryGetValue("AddComponent", out lst))
  90. {
  91. foreach(var m in lst)
  92. {
  93. if(m.MatchGenericParameters(args, typeof(ETModel.SceneChangeComponent)))
  94. {
  95. method = m.MakeGenericMethod(args);
  96. app.RegisterCLRMethodRedirection(method, AddComponent_4);
  97. break;
  98. }
  99. }
  100. }
  101. args = new Type[]{typeof(ETModel.UnitComponent)};
  102. if (genericMethods.TryGetValue("GetComponent", out lst))
  103. {
  104. foreach(var m in lst)
  105. {
  106. if(m.MatchGenericParameters(args, typeof(ETModel.UnitComponent)))
  107. {
  108. method = m.MakeGenericMethod(args);
  109. app.RegisterCLRMethodRedirection(method, GetComponent_5);
  110. break;
  111. }
  112. }
  113. }
  114. args = new Type[]{typeof(ETModel.AnimatorComponent)};
  115. if (genericMethods.TryGetValue("GetComponent", out lst))
  116. {
  117. foreach(var m in lst)
  118. {
  119. if(m.MatchGenericParameters(args, typeof(ETModel.AnimatorComponent)))
  120. {
  121. method = m.MakeGenericMethod(args);
  122. app.RegisterCLRMethodRedirection(method, GetComponent_6);
  123. break;
  124. }
  125. }
  126. }
  127. args = new Type[]{typeof(ETModel.UnitPathComponent)};
  128. if (genericMethods.TryGetValue("GetComponent", out lst))
  129. {
  130. foreach(var m in lst)
  131. {
  132. if(m.MatchGenericParameters(args, typeof(ETModel.UnitPathComponent)))
  133. {
  134. method = m.MakeGenericMethod(args);
  135. app.RegisterCLRMethodRedirection(method, GetComponent_7);
  136. break;
  137. }
  138. }
  139. }
  140. args = new Type[]{typeof(ETModel.MessageDispatcherComponent)};
  141. if (genericMethods.TryGetValue("GetComponent", out lst))
  142. {
  143. foreach(var m in lst)
  144. {
  145. if(m.MatchGenericParameters(args, typeof(ETModel.MessageDispatcherComponent)))
  146. {
  147. method = m.MakeGenericMethod(args);
  148. app.RegisterCLRMethodRedirection(method, GetComponent_8);
  149. break;
  150. }
  151. }
  152. }
  153. args = new Type[]{typeof(ETModel.OpcodeTypeComponent)};
  154. if (genericMethods.TryGetValue("GetComponent", out lst))
  155. {
  156. foreach(var m in lst)
  157. {
  158. if(m.MatchGenericParameters(args, typeof(ETModel.OpcodeTypeComponent)))
  159. {
  160. method = m.MakeGenericMethod(args);
  161. app.RegisterCLRMethodRedirection(method, GetComponent_9);
  162. break;
  163. }
  164. }
  165. }
  166. args = new Type[]{typeof(ETModel.SessionCallbackComponent)};
  167. if (genericMethods.TryGetValue("AddComponent", out lst))
  168. {
  169. foreach(var m in lst)
  170. {
  171. if(m.MatchGenericParameters(args, typeof(ETModel.SessionCallbackComponent)))
  172. {
  173. method = m.MakeGenericMethod(args);
  174. app.RegisterCLRMethodRedirection(method, AddComponent_10);
  175. break;
  176. }
  177. }
  178. }
  179. }
  180. static StackObject* GetComponent_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  181. {
  182. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  183. StackObject* ptr_of_this_method;
  184. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  185. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  186. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  187. __intp.Free(ptr_of_this_method);
  188. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.ResourcesComponent>();
  189. object obj_result_of_this_method = result_of_this_method;
  190. if(obj_result_of_this_method is CrossBindingAdaptorType)
  191. {
  192. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  193. }
  194. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  195. }
  196. static StackObject* GetComponent_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  197. {
  198. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  199. StackObject* ptr_of_this_method;
  200. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  201. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  202. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  203. __intp.Free(ptr_of_this_method);
  204. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.NetOuterComponent>();
  205. object obj_result_of_this_method = result_of_this_method;
  206. if(obj_result_of_this_method is CrossBindingAdaptorType)
  207. {
  208. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  209. }
  210. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  211. }
  212. static StackObject* AddComponent_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  213. {
  214. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  215. StackObject* ptr_of_this_method;
  216. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  217. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  218. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  219. __intp.Free(ptr_of_this_method);
  220. var result_of_this_method = instance_of_this_method.AddComponent<ETModel.SessionComponent>();
  221. object obj_result_of_this_method = result_of_this_method;
  222. if(obj_result_of_this_method is CrossBindingAdaptorType)
  223. {
  224. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  225. }
  226. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  227. }
  228. static StackObject* GetComponent_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  229. {
  230. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  231. StackObject* ptr_of_this_method;
  232. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  233. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  234. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  235. __intp.Free(ptr_of_this_method);
  236. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.PlayerComponent>();
  237. object obj_result_of_this_method = result_of_this_method;
  238. if(obj_result_of_this_method is CrossBindingAdaptorType)
  239. {
  240. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  241. }
  242. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  243. }
  244. static StackObject* AddComponent_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  245. {
  246. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  247. StackObject* ptr_of_this_method;
  248. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  249. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  250. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  251. __intp.Free(ptr_of_this_method);
  252. var result_of_this_method = instance_of_this_method.AddComponent<ETModel.SceneChangeComponent>();
  253. object obj_result_of_this_method = result_of_this_method;
  254. if(obj_result_of_this_method is CrossBindingAdaptorType)
  255. {
  256. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  257. }
  258. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  259. }
  260. static StackObject* GetComponent_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  261. {
  262. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  263. StackObject* ptr_of_this_method;
  264. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  265. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  266. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  267. __intp.Free(ptr_of_this_method);
  268. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.UnitComponent>();
  269. object obj_result_of_this_method = result_of_this_method;
  270. if(obj_result_of_this_method is CrossBindingAdaptorType)
  271. {
  272. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  273. }
  274. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  275. }
  276. static StackObject* GetComponent_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  277. {
  278. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  279. StackObject* ptr_of_this_method;
  280. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  281. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  282. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  283. __intp.Free(ptr_of_this_method);
  284. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.AnimatorComponent>();
  285. object obj_result_of_this_method = result_of_this_method;
  286. if(obj_result_of_this_method is CrossBindingAdaptorType)
  287. {
  288. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  289. }
  290. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  291. }
  292. static StackObject* GetComponent_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  293. {
  294. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  295. StackObject* ptr_of_this_method;
  296. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  297. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  298. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  299. __intp.Free(ptr_of_this_method);
  300. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.UnitPathComponent>();
  301. object obj_result_of_this_method = result_of_this_method;
  302. if(obj_result_of_this_method is CrossBindingAdaptorType)
  303. {
  304. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  305. }
  306. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  307. }
  308. static StackObject* GetComponent_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  309. {
  310. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  311. StackObject* ptr_of_this_method;
  312. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  313. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  314. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  315. __intp.Free(ptr_of_this_method);
  316. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.MessageDispatcherComponent>();
  317. object obj_result_of_this_method = result_of_this_method;
  318. if(obj_result_of_this_method is CrossBindingAdaptorType)
  319. {
  320. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  321. }
  322. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  323. }
  324. static StackObject* GetComponent_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  325. {
  326. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  327. StackObject* ptr_of_this_method;
  328. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  329. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  330. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  331. __intp.Free(ptr_of_this_method);
  332. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.OpcodeTypeComponent>();
  333. object obj_result_of_this_method = result_of_this_method;
  334. if(obj_result_of_this_method is CrossBindingAdaptorType)
  335. {
  336. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  337. }
  338. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  339. }
  340. static StackObject* AddComponent_10(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  341. {
  342. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  343. StackObject* ptr_of_this_method;
  344. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  345. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  346. ETModel.Entity instance_of_this_method = (ETModel.Entity)typeof(ETModel.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  347. __intp.Free(ptr_of_this_method);
  348. var result_of_this_method = instance_of_this_method.AddComponent<ETModel.SessionCallbackComponent>();
  349. object obj_result_of_this_method = result_of_this_method;
  350. if(obj_result_of_this_method is CrossBindingAdaptorType)
  351. {
  352. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  353. }
  354. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  355. }
  356. }
  357. }