public void Get(RealStatePtr L, int index, out decimal val) { LuaTypes lua_type = LuaAPI.lua_type(L, index); if (lua_type == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != decimal_type_id) { throw new Exception("invalid userdata for decimal!"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack decimal fail!"); } } else if (lua_type == LuaTypes.LUA_TNUMBER) { if (LuaAPI.lua_isint64(L, index)) { val = (decimal)LuaAPI.lua_toint64(L, index); } else { val = (decimal)LuaAPI.lua_tonumber(L, index); // has gc } } else { throw new Exception("invalid lua value for decimal, LuaType=" + lua_type); } }
private static void Resetzstrings(RealStatePtr L) { int gen_param_count = LuaAPI.lua_gettop(L); for (int index = 3; index <= gen_param_count; index++) { zstring zstr = null; LuaTypes type = LuaAPI.lua_type(L, index); if (LuaAPI.lua_isint64(L, index)) { zstr = LuaAPI.lua_toint64(L, index); } else if (LuaAPI.lua_isinteger(L, index)) { zstr = LuaAPI.xlua_tointeger(L, index); } else if (LuaAPI.lua_isnumber(L, index)) { zstr = (float)LuaAPI.lua_tonumber(L, index); } else if (LuaTypes.LUA_TBOOLEAN == type) { zstr = LuaAPI.lua_toboolean(L, index); } else if (LuaTypes.LUA_TSTRING == type) { zstr = lua_tozstring(L, index); } zstrings[index - 3] = zstr; } }
static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3))) { string _lexeme = LuaAPI.lua_tostring(L, 2); long _value = LuaAPI.lua_toint64(L, 3); MongoDB.Bson.IO.Int64JsonToken gen_ret = new MongoDB.Bson.IO.Int64JsonToken(_lexeme, _value); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.IO.Int64JsonToken constructor!")); }
static int _m_ToObject_xlua_st_(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int __gen_param_count = LuaAPI.lua_gettop(L); try { if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); byte value = (byte)LuaAPI.lua_tonumber(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); short value = (short)LuaAPI.xlua_tointeger(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); int value = LuaAPI.xlua_tointeger(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); long value = LuaAPI.lua_toint64(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); sbyte value = (sbyte)LuaAPI.xlua_tointeger(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); ushort value = (ushort)LuaAPI.xlua_tointeger(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); uint value = LuaAPI.xlua_touint(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isuint64(L, 2))) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); ulong value = LuaAPI.lua_touint64(L, 2); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } if (__gen_param_count == 2 && translator.Assignable <System.Type>(L, 1) && translator.Assignable <object>(L, 2)) { System.Type enumType = (System.Type)translator.GetObject(L, 1, typeof(System.Type)); object value = translator.GetObject(L, 2, typeof(object)); object __cl_gen_ret = System.Enum.ToObject(enumType, value); translator.PushAny(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.Enum.ToObject!")); }
static int _m_AddOrUpdate(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Collections.Concurrent.ConcurrentDictionary <long, ulong> gen_to_be_invoked = (System.Collections.Concurrent.ConcurrentDictionary <long, ulong>)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 4 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isuint64(L, 3)) && translator.Assignable <System.Func <long, ulong, ulong> >(L, 4)) { long _key = LuaAPI.lua_toint64(L, 2); ulong _addValue = LuaAPI.lua_touint64(L, 3); System.Func <long, ulong, ulong> _updateValueFactory = translator.GetDelegate <System.Func <long, ulong, ulong> >(L, 4); ulong gen_ret = gen_to_be_invoked.AddOrUpdate( _key, _addValue, _updateValueFactory); LuaAPI.lua_pushuint64(L, gen_ret); return(1); } if (gen_param_count == 4 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)) && translator.Assignable <System.Func <long, ulong> >(L, 3) && translator.Assignable <System.Func <long, ulong, ulong> >(L, 4)) { long _key = LuaAPI.lua_toint64(L, 2); System.Func <long, ulong> _addValueFactory = translator.GetDelegate <System.Func <long, ulong> >(L, 3); System.Func <long, ulong, ulong> _updateValueFactory = translator.GetDelegate <System.Func <long, ulong, ulong> >(L, 4); ulong gen_ret = gen_to_be_invoked.AddOrUpdate( _key, _addValueFactory, _updateValueFactory); LuaAPI.lua_pushuint64(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.Collections.Concurrent.ConcurrentDictionary<long, ulong>.AddOrUpdate!")); }
static int _m_TryStartNoGCRegion_xlua_st_(RealStatePtr L) { try { int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 1 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1))) { long _totalSize = LuaAPI.lua_toint64(L, 1); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1)) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _totalSize = LuaAPI.lua_toint64(L, 1); long _lohSize = LuaAPI.lua_toint64(L, 2); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize, _lohSize); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1)) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)) { long _totalSize = LuaAPI.lua_toint64(L, 1); bool _disallowFullBlockingGC = LuaAPI.lua_toboolean(L, 2); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize, _disallowFullBlockingGC); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1)) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) { long _totalSize = LuaAPI.lua_toint64(L, 1); long _lohSize = LuaAPI.lua_toint64(L, 2); bool _disallowFullBlockingGC = LuaAPI.lua_toboolean(L, 3); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize, _lohSize, _disallowFullBlockingGC); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.GC.TryStartNoGCRegion!")); }
static int _m_Write(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.IO.BinaryWriter gen_to_be_invoked = (System.IO.BinaryWriter)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)) { bool _value = LuaAPI.lua_toboolean(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { byte _value = (byte)LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { sbyte _value = (sbyte)LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { char _ch = (char)LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.Write(_ch); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { double _value = LuaAPI.lua_tonumber(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { short _value = (short)LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { ushort _value = (ushort)LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { int _value = LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { uint _value = LuaAPI.xlua_touint(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _value = LuaAPI.lua_toint64(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isuint64(L, 2))) { ulong _value = LuaAPI.lua_touint64(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { float _value = (float)LuaAPI.lua_tonumber(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) { byte[] _buffer = LuaAPI.lua_tobytes(L, 2); gen_to_be_invoked.Write(_buffer); return(0); } if (gen_param_count == 2 && translator.Assignable <char[]>(L, 2)) { char[] _chars = (char[])translator.GetObject(L, 2, typeof(char[])); gen_to_be_invoked.Write(_chars); return(0); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || translator.IsDecimal(L, 2))) { decimal _value; translator.Get(L, 2, out _value); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) { string _value = LuaAPI.lua_tostring(L, 2); gen_to_be_invoked.Write(_value); return(0); } if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) { byte[] _buffer = LuaAPI.lua_tobytes(L, 2); int _index = LuaAPI.xlua_tointeger(L, 3); int _count = LuaAPI.xlua_tointeger(L, 4); gen_to_be_invoked.Write(_buffer, _index, _count); return(0); } if (gen_param_count == 4 && translator.Assignable <char[]>(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) { char[] _chars = (char[])translator.GetObject(L, 2, typeof(char[])); int _index = LuaAPI.xlua_tointeger(L, 3); int _count = LuaAPI.xlua_tointeger(L, 4); gen_to_be_invoked.Write(_chars, _index, _count); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.IO.BinaryWriter.Write!")); }
private object getObject(RealStatePtr L, int idx, object target) { //return translator.getObject(L, idx); //TODO: translator.getObject move to here?? LuaTypes type = (LuaTypes)LuaAPI.lua_type(L, idx); switch (type) { case LuaTypes.LUA_TNUMBER: { if (LuaAPI.lua_isint64(L, idx)) { return(LuaAPI.lua_toint64(L, idx)); } else if (LuaAPI.lua_isinteger(L, idx)) { return(LuaAPI.xlua_tointeger(L, idx)); } else { return(LuaAPI.lua_tonumber(L, idx)); } } case LuaTypes.LUA_TSTRING: { return(LuaAPI.lua_tostring(L, idx)); } case LuaTypes.LUA_TBOOLEAN: { return(LuaAPI.lua_toboolean(L, idx)); } case LuaTypes.LUA_TTABLE: { return(getLuaTable(L, idx, null)); } case LuaTypes.LUA_TFUNCTION: { return(getLuaFunction(L, idx, null)); } case LuaTypes.LUA_TUSERDATA: { if (LuaAPI.lua_isint64(L, idx)) { return(LuaAPI.lua_toint64(L, idx)); } else if (LuaAPI.lua_isuint64(L, idx)) { return(LuaAPI.lua_touint64(L, idx)); } else { return(translator.SafeGetCSObj(L, idx)); } } default: return(null); } }
static int _m_GetLong_xlua_st_(RealStatePtr L) { try { int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 1 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)) { string _key = LuaAPI.lua_tostring(L, 1); long gen_ret = UnityEngine.RemoteSettings.GetLong(_key); LuaAPI.lua_pushint64(L, gen_ret); return(1); } if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { string _key = LuaAPI.lua_tostring(L, 1); long _defaultValue = LuaAPI.lua_toint64(L, 2); long gen_ret = UnityEngine.RemoteSettings.GetLong(_key, _defaultValue); LuaAPI.lua_pushint64(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.RemoteSettings.GetLong!")); }
static int _m_Write(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); LitJson.JsonWriter gen_to_be_invoked = (LitJson.JsonWriter)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)) { bool _boolean = LuaAPI.lua_toboolean(L, 2); gen_to_be_invoked.Write(_boolean); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { double _number = LuaAPI.lua_tonumber(L, 2); gen_to_be_invoked.Write(_number); return(0); } if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { int _number = LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.Write(_number); return(0); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _number = LuaAPI.lua_toint64(L, 2); gen_to_be_invoked.Write(_number); return(0); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isuint64(L, 2))) { ulong _number = LuaAPI.lua_touint64(L, 2); gen_to_be_invoked.Write(_number); return(0); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || translator.IsDecimal(L, 2))) { decimal _number; translator.Get(L, 2, out _number); gen_to_be_invoked.Write(_number); return(0); } if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) { string _str = LuaAPI.lua_tostring(L, 2); gen_to_be_invoked.Write(_str); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to LitJson.JsonWriter.Write!")); }
static int _m_GetLong(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.RemoteConfigSettings gen_to_be_invoked = (UnityEngine.RemoteConfigSettings)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) { string _key = LuaAPI.lua_tostring(L, 2); var gen_ret = gen_to_be_invoked.GetLong(_key); LuaAPI.lua_pushint64(L, gen_ret); return(1); } if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3))) { string _key = LuaAPI.lua_tostring(L, 2); long _defaultValue = LuaAPI.lua_toint64(L, 3); var gen_ret = gen_to_be_invoked.GetLong(_key, _defaultValue); LuaAPI.lua_pushint64(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.RemoteConfigSettings.GetLong!")); }
static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _newAddress = LuaAPI.lua_toint64(L, 2); System.Net.IPAddress gen_ret = new System.Net.IPAddress(_newAddress); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3))) { byte[] _address = LuaAPI.lua_tobytes(L, 2); long _scopeid = LuaAPI.lua_toint64(L, 3); System.Net.IPAddress gen_ret = new System.Net.IPAddress(_address, _scopeid); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) { byte[] _address = LuaAPI.lua_tobytes(L, 2); System.Net.IPAddress gen_ret = new System.Net.IPAddress(_address); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.Net.IPAddress constructor!")); }
static int _m_ToString_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 1 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 1)) { bool _value = LuaAPI.lua_toboolean(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { double _value = LuaAPI.lua_tonumber(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { float _value = (float)LuaAPI.lua_tonumber(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { int _value = LuaAPI.xlua_tointeger(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1))) { long _value = LuaAPI.lua_toint64(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { short _value = (short)LuaAPI.xlua_tointeger(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { uint _value = LuaAPI.xlua_touint(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isuint64(L, 1))) { ulong _value = LuaAPI.lua_touint64(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { ushort _value = (ushort)LuaAPI.xlua_tointeger(L, 1); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && translator.Assignable <System.DateTime>(L, 1)) { System.DateTime _value; translator.Get(L, 1, out _value); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && translator.Assignable <System.DateTimeOffset>(L, 1)) { System.DateTimeOffset _value; translator.Get(L, 1, out _value); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || translator.IsDecimal(L, 1))) { decimal _value; translator.Get(L, 1, out _value); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && translator.Assignable <MongoDB.Bson.Decimal128>(L, 1)) { MongoDB.Bson.Decimal128 _value; translator.Get(L, 1, out _value); string gen_ret = MongoDB.Bson.IO.JsonConvert.ToString(_value); LuaAPI.lua_pushstring(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.IO.JsonConvert.ToString!")); }
static int _m_NetworkToHostOrder_xlua_st_(RealStatePtr L) { try { int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 1 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1))) { long _network = LuaAPI.lua_toint64(L, 1); long gen_ret = System.Net.IPAddress.NetworkToHostOrder( _network); LuaAPI.lua_pushint64(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { int _network = LuaAPI.xlua_tointeger(L, 1); int gen_ret = System.Net.IPAddress.NetworkToHostOrder( _network); LuaAPI.xlua_pushinteger(L, gen_ret); return(1); } if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) { short _network = (short)LuaAPI.xlua_tointeger(L, 1); short gen_ret = System.Net.IPAddress.NetworkToHostOrder( _network); LuaAPI.xlua_pushinteger(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.Net.IPAddress.NetworkToHostOrder!")); }
static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _value = LuaAPI.lua_toint64(L, 2); MongoDB.Bson.BsonTimestamp gen_ret = new MongoDB.Bson.BsonTimestamp(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _timestamp = LuaAPI.xlua_tointeger(L, 2); int _increment = LuaAPI.xlua_tointeger(L, 3); MongoDB.Bson.BsonTimestamp gen_ret = new MongoDB.Bson.BsonTimestamp(_timestamp, _increment); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.BsonTimestamp constructor!")); }
static int _m_GenerateId(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); MongoDB.Bson.Serialization.IdGenerators.AscendingGuidGenerator gen_to_be_invoked = (MongoDB.Bson.Serialization.IdGenerators.AscendingGuidGenerator)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 4 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) { long _tickCount = LuaAPI.lua_toint64(L, 2); byte[] _machineProcessId = LuaAPI.lua_tobytes(L, 3); int _increment = LuaAPI.xlua_tointeger(L, 4); object gen_ret = gen_to_be_invoked.GenerateId(_tickCount, _machineProcessId, _increment); translator.PushAny(L, gen_ret); return(1); } if (gen_param_count == 3 && translator.Assignable <object>(L, 2) && translator.Assignable <object>(L, 3)) { object _container = translator.GetObject(L, 2, typeof(object)); object _document = translator.GetObject(L, 3, typeof(object)); object gen_ret = gen_to_be_invoked.GenerateId(_container, _document); translator.PushAny(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.Serialization.IdGenerators.AscendingGuidGenerator.GenerateId!")); }
static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3)) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)) { string _elementName = LuaAPI.lua_tostring(L, 2); long _flag = LuaAPI.lua_toint64(L, 3); bool _isOptional = LuaAPI.lua_toboolean(L, 4); MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member gen_ret = new MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member(_elementName, _flag, _isOptional); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3))) { string _elementName = LuaAPI.lua_tostring(L, 2); long _flag = LuaAPI.lua_toint64(L, 3); MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member gen_ret = new MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member(_elementName, _flag); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member constructor!")); }
static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || translator.IsDecimal(L, 2))) { decimal _value; translator.Get(L, 2, out _value); MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { double _value = LuaAPI.lua_tonumber(L, 2); MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { float _value = (float)LuaAPI.lua_tonumber(L, 2); MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { int _value = LuaAPI.xlua_tointeger(L, 2); MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _value = LuaAPI.lua_toint64(L, 2); MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { uint _value = LuaAPI.xlua_touint(L, 2); MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isuint64(L, 2))) { ulong _value = LuaAPI.lua_touint64(L, 2); MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 1) { translator.Push(L, default(MongoDB.Bson.Decimal128)); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.Decimal128 constructor!")); }
private static object longCaster(RealStatePtr L, int idx, object target) { return((LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TNUMBER || LuaAPI.lua_isint64(L, idx)) ? (object)LuaAPI.lua_toint64(L, idx) : null); }
static int _m_Insert(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Text.StringBuilder gen_to_be_invoked = (System.Text.StringBuilder)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); bool _value = LuaAPI.lua_toboolean(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); sbyte _value = (sbyte)LuaAPI.xlua_tointeger(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); byte _value = (byte)LuaAPI.xlua_tointeger(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); short _value = (short)LuaAPI.xlua_tointeger(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); char _value = (char)LuaAPI.xlua_tointeger(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); int _value = LuaAPI.xlua_tointeger(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3))) { int _index = LuaAPI.xlua_tointeger(L, 2); long _value = LuaAPI.lua_toint64(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); float _value = (float)LuaAPI.lua_tonumber(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); double _value = LuaAPI.lua_tonumber(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); ushort _value = (ushort)LuaAPI.xlua_tointeger(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); uint _value = LuaAPI.xlua_touint(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isuint64(L, 3))) { int _index = LuaAPI.xlua_tointeger(L, 2); ulong _value = LuaAPI.lua_touint64(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING)) { int _index = LuaAPI.xlua_tointeger(L, 2); string _value = LuaAPI.lua_tostring(L, 3); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <char[]>(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); char[] _value = (char[])translator.GetObject(L, 3, typeof(char[])); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || translator.IsDecimal(L, 3))) { int _index = LuaAPI.xlua_tointeger(L, 2); decimal _value; translator.Get(L, 3, out _value); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <object>(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); object _value = translator.GetObject(L, 3, typeof(object)); var gen_ret = gen_to_be_invoked.Insert(_index, _value); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) { int _index = LuaAPI.xlua_tointeger(L, 2); string _value = LuaAPI.lua_tostring(L, 3); int _count = LuaAPI.xlua_tointeger(L, 4); var gen_ret = gen_to_be_invoked.Insert(_index, _value, _count); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <char[]>(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)) { int _index = LuaAPI.xlua_tointeger(L, 2); char[] _value = (char[])translator.GetObject(L, 3, typeof(char[])); int _startIndex = LuaAPI.xlua_tointeger(L, 4); int _charCount = LuaAPI.xlua_tointeger(L, 5); var gen_ret = gen_to_be_invoked.Insert(_index, _value, _startIndex, _charCount); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.Text.StringBuilder.Insert!")); }
private bool int64Check(RealStatePtr L, int idx) { return(LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TNUMBER || LuaAPI.lua_isint64(L, idx)); }
int SystemGC_m_TryStartNoGCRegion_xlua_st_(RealStatePtr L, int gen_param_count) { if (gen_param_count == 1 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1))) { long _totalSize = LuaAPI.lua_toint64(L, 1); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1)) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _totalSize = LuaAPI.lua_toint64(L, 1); long _lohSize = LuaAPI.lua_toint64(L, 2); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize, _lohSize); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1)) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)) { long _totalSize = LuaAPI.lua_toint64(L, 1); bool _disallowFullBlockingGC = LuaAPI.lua_toboolean(L, 2); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize, _disallowFullBlockingGC); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1)) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) { long _totalSize = LuaAPI.lua_toint64(L, 1); long _lohSize = LuaAPI.lua_toint64(L, 2); bool _disallowFullBlockingGC = LuaAPI.lua_toboolean(L, 3); bool gen_ret = System.GC.TryStartNoGCRegion(_totalSize, _lohSize, _disallowFullBlockingGC); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } return(LuaAPI.luaL_error(L, "invalid arguments to System.GC.TryStartNoGCRegion!")); }
static int _m_DateTimeTextMaxWithHour_xlua_st_(RealStatePtr L) { try { int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1)) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)) { long _duration = LuaAPI.lua_toint64(L, 1); bool _fullDisplay = LuaAPI.lua_toboolean(L, 2); string gen_ret = XLuaFramework.LongExtension.DateTimeTextMaxWithHour(_duration, _fullDisplay); LuaAPI.lua_pushstring(L, gen_ret); return(1); } if (gen_param_count == 1 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) || LuaAPI.lua_isint64(L, 1))) { long _duration = LuaAPI.lua_toint64(L, 1); string gen_ret = XLuaFramework.LongExtension.DateTimeTextMaxWithHour(_duration); LuaAPI.lua_pushstring(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to XLuaFramework.LongExtension.DateTimeTextMaxWithHour!")); }
static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2))) { long _i = LuaAPI.lua_toint64(L, 2); XLua.Cast.Int64 gen_ret = new XLua.Cast.Int64(_i); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to XLua.Cast.Int64 constructor!")); }
static int __CreateInstance(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { if (LuaAPI.lua_gettop(L) == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3))) { uint key = LuaAPI.xlua_touint(L, 2); long ori_value = LuaAPI.lua_toint64(L, 3); xc.DefaultActorAttribute __cl_gen_ret = new xc.DefaultActorAttribute(key, ori_value); translator.Push(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to xc.DefaultActorAttribute constructor!")); }
static int _m_Pack_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); byte _field = (byte)LuaAPI.xlua_tointeger(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); sbyte _field = (sbyte)LuaAPI.xlua_tointeger(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); short _field = (short)LuaAPI.xlua_tointeger(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); ushort _field = (ushort)LuaAPI.xlua_tointeger(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); int _field = LuaAPI.xlua_tointeger(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); uint _field = LuaAPI.xlua_touint(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3))) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); long _field = LuaAPI.lua_toint64(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isuint64(L, 3))) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); ulong _field = LuaAPI.lua_touint64(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); float _field = (float)LuaAPI.lua_tonumber(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); double _field = LuaAPI.lua_tonumber(L, 3); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || translator.IsDecimal(L, 3))) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); decimal _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Vector2>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Vector2 _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Vector3>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Vector3 _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Vector4>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Vector4 _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Color>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Color _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Quaternion>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Quaternion _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Ray>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Ray _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Bounds>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Bounds _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } if (gen_param_count == 3 && LuaTypes.LUA_TLIGHTUSERDATA == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Ray2D>(L, 3)) { System.IntPtr _buff = LuaAPI.lua_touserdata(L, 1); int _offset = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Ray2D _field; translator.Get(L, 3, out _field); bool gen_ret = XLua.CopyByValue.Pack(_buff, _offset, _field); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to XLua.CopyByValue.Pack!")); }
static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 3 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { long _address = LuaAPI.lua_toint64(L, 2); int _port = LuaAPI.xlua_tointeger(L, 3); System.Net.IPEndPoint gen_ret = new System.Net.IPEndPoint(_address, _port); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 3 && translator.Assignable <System.Net.IPAddress>(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { System.Net.IPAddress _address = (System.Net.IPAddress)translator.GetObject(L, 2, typeof(System.Net.IPAddress)); int _port = LuaAPI.xlua_tointeger(L, 3); System.Net.IPEndPoint gen_ret = new System.Net.IPEndPoint(_address, _port); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to System.Net.IPEndPoint constructor!")); }
static int _m_CreateScene_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 4 && translator.Assignable <DCET.Model.SceneType>(L, 1) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <DCET.Model.Scene>(L, 3) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) || LuaAPI.lua_isint64(L, 4))) { DCET.Model.SceneType _sceneType; translator.Get(L, 1, out _sceneType); string _name = LuaAPI.lua_tostring(L, 2); DCET.Model.Scene _parent = (DCET.Model.Scene)translator.GetObject(L, 3, typeof(DCET.Model.Scene)); long _id = LuaAPI.lua_toint64(L, 4); DCET.Model.Scene gen_ret = DCET.Model.EntityFactory.CreateScene(_sceneType, _name, _parent, _id); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 3 && translator.Assignable <DCET.Model.SceneType>(L, 1) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <DCET.Model.Scene>(L, 3)) { DCET.Model.SceneType _sceneType; translator.Get(L, 1, out _sceneType); string _name = LuaAPI.lua_tostring(L, 2); DCET.Model.Scene _parent = (DCET.Model.Scene)translator.GetObject(L, 3, typeof(DCET.Model.Scene)); DCET.Model.Scene gen_ret = DCET.Model.EntityFactory.CreateScene(_sceneType, _name, _parent); translator.Push(L, gen_ret); return(1); } if (gen_param_count == 2 && translator.Assignable <DCET.Model.SceneType>(L, 1) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) { DCET.Model.SceneType _sceneType; translator.Get(L, 1, out _sceneType); string _name = LuaAPI.lua_tostring(L, 2); DCET.Model.Scene gen_ret = DCET.Model.EntityFactory.CreateScene(_sceneType, _name); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to DCET.Model.EntityFactory.CreateScene!")); }
public static bool TryPrimitiveArraySet(Type type, RealStatePtr L, object obj, int array_idx, int obj_idx) { bool ok = true; LuaTypes lua_type = LuaAPI.lua_type(L, obj_idx); if (type == typeof(int[]) && lua_type == LuaTypes.LUA_TNUMBER) { int[] array = obj as int[]; array[array_idx] = LuaAPI.xlua_tointeger(L, obj_idx); } else if (type == typeof(float[]) && lua_type == LuaTypes.LUA_TNUMBER) { float[] array = obj as float[]; array[array_idx] = (float)LuaAPI.lua_tonumber(L, obj_idx); } else if (type == typeof(double[]) && lua_type == LuaTypes.LUA_TNUMBER) { double[] array = obj as double[]; array[array_idx] = LuaAPI.lua_tonumber(L, obj_idx);; } else if (type == typeof(bool[]) && lua_type == LuaTypes.LUA_TBOOLEAN) { bool[] array = obj as bool[]; array[array_idx] = LuaAPI.lua_toboolean(L, obj_idx); } else if (type == typeof(long[]) && LuaAPI.lua_isint64(L, obj_idx)) { long[] array = obj as long[]; array[array_idx] = LuaAPI.lua_toint64(L, obj_idx); } else if (type == typeof(ulong[]) && LuaAPI.lua_isuint64(L, obj_idx)) { ulong[] array = obj as ulong[]; array[array_idx] = LuaAPI.lua_touint64(L, obj_idx); } else if (type == typeof(sbyte[]) && lua_type == LuaTypes.LUA_TNUMBER) { sbyte[] array = obj as sbyte[]; array[array_idx] = (sbyte)LuaAPI.xlua_tointeger(L, obj_idx); } else if (type == typeof(short[]) && lua_type == LuaTypes.LUA_TNUMBER) { short[] array = obj as short[]; array[array_idx] = (short)LuaAPI.xlua_tointeger(L, obj_idx); } else if (type == typeof(ushort[]) && lua_type == LuaTypes.LUA_TNUMBER) { ushort[] array = obj as ushort[]; array[array_idx] = (ushort)LuaAPI.xlua_tointeger(L, obj_idx); } else if (type == typeof(char[]) && lua_type == LuaTypes.LUA_TNUMBER) { char[] array = obj as char[]; array[array_idx] = (char)LuaAPI.xlua_tointeger(L, obj_idx); } else if (type == typeof(uint[]) && lua_type == LuaTypes.LUA_TNUMBER) { uint[] array = obj as uint[]; array[array_idx] = LuaAPI.xlua_touint(L, obj_idx); } else if (type == typeof(IntPtr[]) && lua_type == LuaTypes.LUA_TLIGHTUSERDATA) { IntPtr[] array = obj as IntPtr[]; array[array_idx] = LuaAPI.lua_touserdata(L, obj_idx); } else if (type == typeof(decimal[])) { decimal[] array = obj as decimal[]; if (lua_type == LuaTypes.LUA_TNUMBER) { array[array_idx] = (decimal)LuaAPI.lua_tonumber(L, obj_idx); } if (lua_type == LuaTypes.LUA_TUSERDATA) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (translator.IsDecimal(L, obj_idx)) { translator.Get(L, obj_idx, out array[array_idx]); } else { ok = false; } } else { ok = false; } } else if (type == typeof(string[]) && lua_type == LuaTypes.LUA_TSTRING) { string[] array = obj as string[]; array[array_idx] = LuaAPI.lua_tostring(L, obj_idx); } else { ok = false; } return(ok); }
public static int __NewIndexer(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { if (translator.Assignable <System.Collections.Concurrent.ConcurrentDictionary <long, ulong> >(L, 1) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isuint64(L, 3))) { System.Collections.Concurrent.ConcurrentDictionary <long, ulong> gen_to_be_invoked = (System.Collections.Concurrent.ConcurrentDictionary <long, ulong>)translator.FastGetCSObj(L, 1); long key = LuaAPI.lua_toint64(L, 2); gen_to_be_invoked[key] = LuaAPI.lua_touint64(L, 3); LuaAPI.lua_pushboolean(L, true); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } LuaAPI.lua_pushboolean(L, false); return(1); }