GFGGame_LocalCache_Binding.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 GFGGame_LocalCache_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
  20. MethodBase method;
  21. Type[] args;
  22. Type type = typeof(GFGGame.LocalCache);
  23. args = new Type[]{typeof(System.String), typeof(System.Boolean)};
  24. method = type.GetMethod("GetBool", flag, null, args, null);
  25. app.RegisterCLRMethodRedirection(method, GetBool_0);
  26. args = new Type[]{typeof(System.String), typeof(System.Boolean)};
  27. method = type.GetMethod("SetBool", flag, null, args, null);
  28. app.RegisterCLRMethodRedirection(method, SetBool_1);
  29. args = new Type[]{};
  30. method = type.GetMethod("InitLocalData", flag, null, args, null);
  31. app.RegisterCLRMethodRedirection(method, InitLocalData_2);
  32. }
  33. static StackObject* GetBool_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  34. {
  35. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  36. StackObject* ptr_of_this_method;
  37. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  38. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  39. System.Boolean @defaultValue = ptr_of_this_method->Value == 1;
  40. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  41. System.String @key = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  42. __intp.Free(ptr_of_this_method);
  43. var result_of_this_method = GFGGame.LocalCache.GetBool(@key, @defaultValue);
  44. __ret->ObjectType = ObjectTypes.Integer;
  45. __ret->Value = result_of_this_method ? 1 : 0;
  46. return __ret + 1;
  47. }
  48. static StackObject* SetBool_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  49. {
  50. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  51. StackObject* ptr_of_this_method;
  52. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  53. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  54. System.Boolean @isOn = ptr_of_this_method->Value == 1;
  55. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  56. System.String @key = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  57. __intp.Free(ptr_of_this_method);
  58. GFGGame.LocalCache.SetBool(@key, @isOn);
  59. return __ret;
  60. }
  61. static StackObject* InitLocalData_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  62. {
  63. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  64. StackObject* __ret = ILIntepreter.Minus(__esp, 0);
  65. GFGGame.LocalCache.InitLocalData();
  66. return __ret;
  67. }
  68. }
  69. }