System_Int32Wrap.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class System_Int32Wrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginClass(typeof(System.Int32), null);
  9. L.RegFunction("CompareTo", CompareTo);
  10. L.RegFunction("Equals", Equals);
  11. L.RegFunction("GetHashCode", GetHashCode);
  12. L.RegFunction("ToString", ToString);
  13. L.RegFunction("Parse", Parse);
  14. L.RegFunction("TryParse", TryParse);
  15. L.RegFunction("GetTypeCode", GetTypeCode);
  16. L.RegFunction("New", _CreateSystem_Int32);
  17. L.RegFunction("__tostring", ToLua.op_ToString);
  18. L.RegConstant("MaxValue", 2147483647);
  19. L.RegConstant("MinValue", -2147483648);
  20. L.EndClass();
  21. }
  22. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  23. static int _CreateSystem_Int32(IntPtr L)
  24. {
  25. System.Int32 obj = new System.Int32();
  26. LuaDLL.lua_pushinteger(L, obj);
  27. return 1;
  28. }
  29. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  30. static int CompareTo(IntPtr L)
  31. {
  32. try
  33. {
  34. int count = LuaDLL.lua_gettop(L);
  35. if (count == 2 && TypeChecker.CheckTypes<int>(L, 2))
  36. {
  37. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  38. int arg0 = (int)LuaDLL.lua_tonumber(L, 2);
  39. int o = obj.CompareTo(arg0);
  40. LuaDLL.lua_pushinteger(L, o);
  41. ToLua.SetBack(L, 1, obj);
  42. return 1;
  43. }
  44. else if (count == 2 && TypeChecker.CheckTypes<object>(L, 2))
  45. {
  46. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  47. object arg0 = ToLua.ToVarObject(L, 2);
  48. int o = obj.CompareTo(arg0);
  49. LuaDLL.lua_pushinteger(L, o);
  50. ToLua.SetBack(L, 1, obj);
  51. return 1;
  52. }
  53. else
  54. {
  55. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int32.CompareTo");
  56. }
  57. }
  58. catch (Exception e)
  59. {
  60. return LuaDLL.toluaL_exception(L, e);
  61. }
  62. }
  63. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  64. static int Equals(IntPtr L)
  65. {
  66. try
  67. {
  68. int count = LuaDLL.lua_gettop(L);
  69. if (count == 2 && TypeChecker.CheckTypes<int>(L, 2))
  70. {
  71. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  72. int arg0 = (int)LuaDLL.lua_tonumber(L, 2);
  73. bool o = obj.Equals(arg0);
  74. LuaDLL.lua_pushboolean(L, o);
  75. ToLua.SetBack(L, 1, obj);
  76. return 1;
  77. }
  78. else if (count == 2 && TypeChecker.CheckTypes<object>(L, 2))
  79. {
  80. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  81. object arg0 = ToLua.ToVarObject(L, 2);
  82. bool o = obj.Equals(arg0);
  83. LuaDLL.lua_pushboolean(L, o);
  84. ToLua.SetBack(L, 1, obj);
  85. return 1;
  86. }
  87. else
  88. {
  89. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int32.Equals");
  90. }
  91. }
  92. catch (Exception e)
  93. {
  94. return LuaDLL.toluaL_exception(L, e);
  95. }
  96. }
  97. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  98. static int GetHashCode(IntPtr L)
  99. {
  100. try
  101. {
  102. ToLua.CheckArgsCount(L, 1);
  103. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  104. int o = obj.GetHashCode();
  105. LuaDLL.lua_pushinteger(L, o);
  106. ToLua.SetBack(L, 1, obj);
  107. return 1;
  108. }
  109. catch (Exception e)
  110. {
  111. return LuaDLL.toluaL_exception(L, e);
  112. }
  113. }
  114. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  115. static int ToString(IntPtr L)
  116. {
  117. try
  118. {
  119. int count = LuaDLL.lua_gettop(L);
  120. if (count == 1)
  121. {
  122. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  123. string o = obj.ToString();
  124. LuaDLL.lua_pushstring(L, o);
  125. return 1;
  126. }
  127. else if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
  128. {
  129. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  130. string arg0 = ToLua.ToString(L, 2);
  131. string o = obj.ToString(arg0);
  132. LuaDLL.lua_pushstring(L, o);
  133. return 1;
  134. }
  135. else if (count == 2 && TypeChecker.CheckTypes<System.IFormatProvider>(L, 2))
  136. {
  137. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  138. System.IFormatProvider arg0 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  139. string o = obj.ToString(arg0);
  140. LuaDLL.lua_pushstring(L, o);
  141. return 1;
  142. }
  143. else if (count == 3)
  144. {
  145. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  146. string arg0 = ToLua.CheckString(L, 2);
  147. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.CheckObject<System.IFormatProvider>(L, 3);
  148. string o = obj.ToString(arg0, arg1);
  149. LuaDLL.lua_pushstring(L, o);
  150. return 1;
  151. }
  152. else
  153. {
  154. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int32.ToString");
  155. }
  156. }
  157. catch (Exception e)
  158. {
  159. return LuaDLL.toluaL_exception(L, e);
  160. }
  161. }
  162. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  163. static int Parse(IntPtr L)
  164. {
  165. try
  166. {
  167. int count = LuaDLL.lua_gettop(L);
  168. if (count == 1)
  169. {
  170. string arg0 = ToLua.CheckString(L, 1);
  171. int o = System.Int32.Parse(arg0);
  172. LuaDLL.lua_pushinteger(L, o);
  173. return 1;
  174. }
  175. else if (count == 2 && TypeChecker.CheckTypes<System.Globalization.NumberStyles>(L, 2))
  176. {
  177. string arg0 = ToLua.CheckString(L, 1);
  178. System.Globalization.NumberStyles arg1 = (System.Globalization.NumberStyles)ToLua.ToObject(L, 2);
  179. int o = System.Int32.Parse(arg0, arg1);
  180. LuaDLL.lua_pushinteger(L, o);
  181. return 1;
  182. }
  183. else if (count == 2 && TypeChecker.CheckTypes<System.IFormatProvider>(L, 2))
  184. {
  185. string arg0 = ToLua.CheckString(L, 1);
  186. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  187. int o = System.Int32.Parse(arg0, arg1);
  188. LuaDLL.lua_pushinteger(L, o);
  189. return 1;
  190. }
  191. else if (count == 3)
  192. {
  193. string arg0 = ToLua.CheckString(L, 1);
  194. System.Globalization.NumberStyles arg1 = (System.Globalization.NumberStyles)ToLua.CheckObject(L, 2, typeof(System.Globalization.NumberStyles));
  195. System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.CheckObject<System.IFormatProvider>(L, 3);
  196. int o = System.Int32.Parse(arg0, arg1, arg2);
  197. LuaDLL.lua_pushinteger(L, o);
  198. return 1;
  199. }
  200. else
  201. {
  202. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int32.Parse");
  203. }
  204. }
  205. catch (Exception e)
  206. {
  207. return LuaDLL.toluaL_exception(L, e);
  208. }
  209. }
  210. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  211. static int TryParse(IntPtr L)
  212. {
  213. try
  214. {
  215. int count = LuaDLL.lua_gettop(L);
  216. if (count == 2)
  217. {
  218. string arg0 = ToLua.CheckString(L, 1);
  219. int arg1;
  220. bool o = System.Int32.TryParse(arg0, out arg1);
  221. LuaDLL.lua_pushboolean(L, o);
  222. LuaDLL.lua_pushinteger(L, arg1);
  223. return 2;
  224. }
  225. else if (count == 4)
  226. {
  227. string arg0 = ToLua.CheckString(L, 1);
  228. System.Globalization.NumberStyles arg1 = (System.Globalization.NumberStyles)ToLua.CheckObject(L, 2, typeof(System.Globalization.NumberStyles));
  229. System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.CheckObject<System.IFormatProvider>(L, 3);
  230. int arg3;
  231. bool o = System.Int32.TryParse(arg0, arg1, arg2, out arg3);
  232. LuaDLL.lua_pushboolean(L, o);
  233. LuaDLL.lua_pushinteger(L, arg3);
  234. return 2;
  235. }
  236. else
  237. {
  238. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int32.TryParse");
  239. }
  240. }
  241. catch (Exception e)
  242. {
  243. return LuaDLL.toluaL_exception(L, e);
  244. }
  245. }
  246. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  247. static int GetTypeCode(IntPtr L)
  248. {
  249. try
  250. {
  251. ToLua.CheckArgsCount(L, 1);
  252. System.Int32 obj = (System.Int32)ToLua.CheckObject(L, 1, typeof(System.Int32));
  253. System.TypeCode o = obj.GetTypeCode();
  254. ToLua.Push(L, o);
  255. ToLua.SetBack(L, 1, obj);
  256. return 1;
  257. }
  258. catch (Exception e)
  259. {
  260. return LuaDLL.toluaL_exception(L, e);
  261. }
  262. }
  263. }