SDoubleWrap.cs 4.5 KB

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