SBoolWrap.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class SBoolWrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginClass(typeof(SBool), null);
  9. L.RegFunction("Encrypt", Encrypt);
  10. L.RegFunction("Decrypt", Decrypt);
  11. L.RegFunction("Equals", Equals);
  12. L.RegFunction("GetHashCode", GetHashCode);
  13. L.RegFunction("ToString", ToString);
  14. L.RegFunction("New", _CreateSBool);
  15. L.RegFunction("__tostring", ToLua.op_ToString);
  16. L.EndClass();
  17. }
  18. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  19. static int _CreateSBool(IntPtr L)
  20. {
  21. SBool obj = new SBool();
  22. ToLua.PushValue(L, obj);
  23. return 1;
  24. }
  25. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  26. static int Encrypt(IntPtr L)
  27. {
  28. try
  29. {
  30. ToLua.CheckArgsCount(L, 2);
  31. bool arg0 = LuaDLL.luaL_checkboolean(L, 1);
  32. int arg1;
  33. int o = SBool.Encrypt(arg0, out arg1);
  34. LuaDLL.lua_pushinteger(L, o);
  35. LuaDLL.lua_pushinteger(L, arg1);
  36. return 2;
  37. }
  38. catch (Exception e)
  39. {
  40. return LuaDLL.toluaL_exception(L, e);
  41. }
  42. }
  43. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  44. static int Decrypt(IntPtr L)
  45. {
  46. try
  47. {
  48. ToLua.CheckArgsCount(L, 2);
  49. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  50. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  51. bool o = SBool.Decrypt(arg0, arg1);
  52. LuaDLL.lua_pushboolean(L, o);
  53. return 1;
  54. }
  55. catch (Exception e)
  56. {
  57. return LuaDLL.toluaL_exception(L, e);
  58. }
  59. }
  60. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  61. static int Equals(IntPtr L)
  62. {
  63. try
  64. {
  65. int count = LuaDLL.lua_gettop(L);
  66. if (count == 2 && TypeChecker.CheckTypes<SBool>(L, 2))
  67. {
  68. SBool obj = (SBool)ToLua.CheckObject(L, 1, typeof(SBool));
  69. SBool arg0 = StackTraits<SBool>.To(L, 2);
  70. bool o = obj.Equals(arg0);
  71. LuaDLL.lua_pushboolean(L, o);
  72. ToLua.SetBack(L, 1, obj);
  73. return 1;
  74. }
  75. else if (count == 2 && TypeChecker.CheckTypes<object>(L, 2))
  76. {
  77. SBool obj = (SBool)ToLua.CheckObject(L, 1, typeof(SBool));
  78. object arg0 = ToLua.ToVarObject(L, 2);
  79. bool o = obj.Equals(arg0);
  80. LuaDLL.lua_pushboolean(L, o);
  81. ToLua.SetBack(L, 1, obj);
  82. return 1;
  83. }
  84. else
  85. {
  86. return LuaDLL.luaL_throw(L, "invalid arguments to method: SBool.Equals");
  87. }
  88. }
  89. catch (Exception e)
  90. {
  91. return LuaDLL.toluaL_exception(L, e);
  92. }
  93. }
  94. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  95. static int GetHashCode(IntPtr L)
  96. {
  97. try
  98. {
  99. ToLua.CheckArgsCount(L, 1);
  100. SBool obj = (SBool)ToLua.CheckObject(L, 1, typeof(SBool));
  101. int o = obj.GetHashCode();
  102. LuaDLL.lua_pushinteger(L, o);
  103. ToLua.SetBack(L, 1, obj);
  104. return 1;
  105. }
  106. catch (Exception e)
  107. {
  108. return LuaDLL.toluaL_exception(L, e);
  109. }
  110. }
  111. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  112. static int ToString(IntPtr L)
  113. {
  114. try
  115. {
  116. ToLua.CheckArgsCount(L, 1);
  117. SBool obj = (SBool)ToLua.CheckObject(L, 1, typeof(SBool));
  118. string o = obj.ToString();
  119. LuaDLL.lua_pushstring(L, o);
  120. return 1;
  121. }
  122. catch (Exception e)
  123. {
  124. return LuaDLL.toluaL_exception(L, e);
  125. }
  126. }
  127. }