SLongWrap.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class SLongWrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginClass(typeof(SLong), 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", _CreateSLong);
  15. L.RegFunction("__tostring", ToLua.op_ToString);
  16. L.EndClass();
  17. }
  18. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  19. static int _CreateSLong(IntPtr L)
  20. {
  21. SLong obj = new SLong();
  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. long arg0 = LuaDLL.tolua_checkint64(L, 1);
  32. int arg1;
  33. long o = SLong.Encrypt(arg0, out arg1);
  34. LuaDLL.tolua_pushint64(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. long arg0 = LuaDLL.tolua_checkint64(L, 1);
  50. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  51. long o = SLong.Decrypt(arg0, arg1);
  52. LuaDLL.tolua_pushint64(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<SLong>(L, 2))
  67. {
  68. SLong obj = (SLong)ToLua.CheckObject(L, 1, typeof(SLong));
  69. SLong arg0 = StackTraits<SLong>.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. SLong obj = (SLong)ToLua.CheckObject(L, 1, typeof(SLong));
  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: SLong.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. SLong obj = (SLong)ToLua.CheckObject(L, 1, typeof(SLong));
  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. int count = LuaDLL.lua_gettop(L);
  117. if (count == 1)
  118. {
  119. SLong obj = (SLong)ToLua.CheckObject(L, 1, typeof(SLong));
  120. string o = obj.ToString();
  121. LuaDLL.lua_pushstring(L, o);
  122. return 1;
  123. }
  124. else if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
  125. {
  126. SLong obj = (SLong)ToLua.CheckObject(L, 1, typeof(SLong));
  127. string arg0 = ToLua.ToString(L, 2);
  128. string o = obj.ToString(arg0);
  129. LuaDLL.lua_pushstring(L, o);
  130. return 1;
  131. }
  132. else if (count == 2 && TypeChecker.CheckTypes<System.IFormatProvider>(L, 2))
  133. {
  134. SLong obj = (SLong)ToLua.CheckObject(L, 1, typeof(SLong));
  135. System.IFormatProvider arg0 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  136. string o = obj.ToString(arg0);
  137. LuaDLL.lua_pushstring(L, o);
  138. return 1;
  139. }
  140. else if (count == 3)
  141. {
  142. SLong obj = (SLong)ToLua.CheckObject(L, 1, typeof(SLong));
  143. string arg0 = ToLua.CheckString(L, 2);
  144. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.CheckObject<System.IFormatProvider>(L, 3);
  145. string o = obj.ToString(arg0, arg1);
  146. LuaDLL.lua_pushstring(L, o);
  147. return 1;
  148. }
  149. else
  150. {
  151. return LuaDLL.luaL_throw(L, "invalid arguments to method: SLong.ToString");
  152. }
  153. }
  154. catch (Exception e)
  155. {
  156. return LuaDLL.toluaL_exception(L, e);
  157. }
  158. }
  159. }