SIntWrap.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class SIntWrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginClass(typeof(SInt), null);
  9. L.RegFunction("Convert", Convert);
  10. L.RegFunction("InvConvert", InvConvert);
  11. L.RegFunction("Encrypt", Encrypt);
  12. L.RegFunction("Decrypt", Decrypt);
  13. L.RegFunction("Equals", Equals);
  14. L.RegFunction("GetHashCode", GetHashCode);
  15. L.RegFunction("ToString", ToString);
  16. L.RegFunction("New", _CreateSInt);
  17. L.RegFunction("__tostring", ToLua.op_ToString);
  18. L.EndClass();
  19. }
  20. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  21. static int _CreateSInt(IntPtr L)
  22. {
  23. SInt obj = new SInt();
  24. ToLua.PushValue(L, obj);
  25. return 1;
  26. }
  27. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  28. static int Convert(IntPtr L)
  29. {
  30. try
  31. {
  32. ToLua.CheckArgsCount(L, 1);
  33. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  34. SInt o = SInt.Convert(arg0);
  35. ToLua.PushValue(L, o);
  36. return 1;
  37. }
  38. catch (Exception e)
  39. {
  40. return LuaDLL.toluaL_exception(L, e);
  41. }
  42. }
  43. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  44. static int InvConvert(IntPtr L)
  45. {
  46. try
  47. {
  48. ToLua.CheckArgsCount(L, 1);
  49. SInt arg0 = StackTraits<SInt>.Check(L, 1);
  50. int o = SInt.InvConvert(arg0);
  51. LuaDLL.lua_pushinteger(L, o);
  52. return 1;
  53. }
  54. catch (Exception e)
  55. {
  56. return LuaDLL.toluaL_exception(L, e);
  57. }
  58. }
  59. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  60. static int Encrypt(IntPtr L)
  61. {
  62. try
  63. {
  64. ToLua.CheckArgsCount(L, 2);
  65. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  66. int arg1;
  67. int o = SInt.Encrypt(arg0, out arg1);
  68. LuaDLL.lua_pushinteger(L, o);
  69. LuaDLL.lua_pushinteger(L, arg1);
  70. return 2;
  71. }
  72. catch (Exception e)
  73. {
  74. return LuaDLL.toluaL_exception(L, e);
  75. }
  76. }
  77. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  78. static int Decrypt(IntPtr L)
  79. {
  80. try
  81. {
  82. ToLua.CheckArgsCount(L, 2);
  83. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  84. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  85. int o = SInt.Decrypt(arg0, arg1);
  86. LuaDLL.lua_pushinteger(L, o);
  87. return 1;
  88. }
  89. catch (Exception e)
  90. {
  91. return LuaDLL.toluaL_exception(L, e);
  92. }
  93. }
  94. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  95. static int Equals(IntPtr L)
  96. {
  97. try
  98. {
  99. int count = LuaDLL.lua_gettop(L);
  100. if (count == 2 && TypeChecker.CheckTypes<SInt>(L, 2))
  101. {
  102. SInt obj = (SInt)ToLua.CheckObject(L, 1, typeof(SInt));
  103. SInt arg0 = StackTraits<SInt>.To(L, 2);
  104. bool o = obj.Equals(arg0);
  105. LuaDLL.lua_pushboolean(L, o);
  106. ToLua.SetBack(L, 1, obj);
  107. return 1;
  108. }
  109. else if (count == 2 && TypeChecker.CheckTypes<object>(L, 2))
  110. {
  111. SInt obj = (SInt)ToLua.CheckObject(L, 1, typeof(SInt));
  112. object arg0 = ToLua.ToVarObject(L, 2);
  113. bool o = obj.Equals(arg0);
  114. LuaDLL.lua_pushboolean(L, o);
  115. ToLua.SetBack(L, 1, obj);
  116. return 1;
  117. }
  118. else
  119. {
  120. return LuaDLL.luaL_throw(L, "invalid arguments to method: SInt.Equals");
  121. }
  122. }
  123. catch (Exception e)
  124. {
  125. return LuaDLL.toluaL_exception(L, e);
  126. }
  127. }
  128. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  129. static int GetHashCode(IntPtr L)
  130. {
  131. try
  132. {
  133. ToLua.CheckArgsCount(L, 1);
  134. SInt obj = (SInt)ToLua.CheckObject(L, 1, typeof(SInt));
  135. int o = obj.GetHashCode();
  136. LuaDLL.lua_pushinteger(L, o);
  137. ToLua.SetBack(L, 1, obj);
  138. return 1;
  139. }
  140. catch (Exception e)
  141. {
  142. return LuaDLL.toluaL_exception(L, e);
  143. }
  144. }
  145. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  146. static int ToString(IntPtr L)
  147. {
  148. try
  149. {
  150. int count = LuaDLL.lua_gettop(L);
  151. if (count == 1)
  152. {
  153. SInt obj = (SInt)ToLua.CheckObject(L, 1, typeof(SInt));
  154. string o = obj.ToString();
  155. LuaDLL.lua_pushstring(L, o);
  156. return 1;
  157. }
  158. else if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
  159. {
  160. SInt obj = (SInt)ToLua.CheckObject(L, 1, typeof(SInt));
  161. string arg0 = ToLua.ToString(L, 2);
  162. string o = obj.ToString(arg0);
  163. LuaDLL.lua_pushstring(L, o);
  164. return 1;
  165. }
  166. else if (count == 2 && TypeChecker.CheckTypes<System.IFormatProvider>(L, 2))
  167. {
  168. SInt obj = (SInt)ToLua.CheckObject(L, 1, typeof(SInt));
  169. System.IFormatProvider arg0 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  170. string o = obj.ToString(arg0);
  171. LuaDLL.lua_pushstring(L, o);
  172. return 1;
  173. }
  174. else if (count == 3)
  175. {
  176. SInt obj = (SInt)ToLua.CheckObject(L, 1, typeof(SInt));
  177. string arg0 = ToLua.CheckString(L, 2);
  178. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.CheckObject<System.IFormatProvider>(L, 3);
  179. string o = obj.ToString(arg0, arg1);
  180. LuaDLL.lua_pushstring(L, o);
  181. return 1;
  182. }
  183. else
  184. {
  185. return LuaDLL.luaL_throw(L, "invalid arguments to method: SInt.ToString");
  186. }
  187. }
  188. catch (Exception e)
  189. {
  190. return LuaDLL.toluaL_exception(L, e);
  191. }
  192. }
  193. }