luaL_checknumber() public static method

public static luaL_checknumber ( IntPtr luaState, int stackPos ) : double
luaState System.IntPtr
stackPos int
return double
コード例 #1
0
        public int Set(IntPtr L)
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4)
            {
                object arg0 = ToLua.CheckVarObject(L, 2, kclass);
                object arg1 = ToLua.ToVarObject(L, 3);
                if (arg1 != null)
                {
                    arg1 = TypeChecker.ChangeType(arg1, property.PropertyType);
                }
                object[] arg2 = ToLua.CheckObjectArray(L, 4);
                property.SetValue(arg0, arg1, arg2);
                return(0);
            }
            else if (count == 7)
            {
                object arg0 = ToLua.CheckVarObject(L, 2, kclass);
                object arg1 = ToLua.ToVarObject(L, 3);
                if (arg1 != null)
                {
                    arg1 = TypeChecker.ChangeType(arg1, property.PropertyType);
                }
                BindingFlags arg2 = (BindingFlags)LuaDLL.luaL_checknumber(L, 4);
                Binder       arg3 = (Binder)ToLua.CheckObject(L, 5, typeof(Binder));
                object[]     arg4 = ToLua.CheckObjectArray(L, 6);
                CultureInfo  arg5 = (CultureInfo)ToLua.CheckObject(L, 7, typeof(CultureInfo));
                property.SetValue(arg0, arg1, arg2, arg3, arg4, arg5);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: LuaInterface.LuaProperty.Set"));
            }
        }
コード例 #2
0
 public double LuaCheckNumber(int stackPos)
 {
     return(LuaDLL.luaL_checknumber(L, stackPos));
 }
コード例 #3
0
        public float CheckFloat(IntPtr L, int stackPos)
        {
            double ret = LuaDLL.luaL_checknumber(L, stackPos);

            return(Convert.ToSingle(ret));
        }
コード例 #4
0
        public decimal CheckDecimal(IntPtr L, int stackPos)
        {
            double ret = LuaDLL.luaL_checknumber(L, stackPos);

            return(Convert.ToDecimal(ret));
        }
コード例 #5
0
        public uint CheckUInt32(IntPtr L, int stackPos)
        {
            double ret = LuaDLL.luaL_checknumber(L, stackPos);

            return(Convert.ToUInt32(ret));
        }
コード例 #6
0
        public char CheckChar(IntPtr L, int stackPos)
        {
            double ret = LuaDLL.luaL_checknumber(L, stackPos);

            return(Convert.ToChar(ret));
        }
コード例 #7
0
        public short CheckInt16(IntPtr L, int stackPos)
        {
            double ret = LuaDLL.luaL_checknumber(L, stackPos);

            return(Convert.ToInt16(ret));
        }
コード例 #8
0
        public byte CheckByte(IntPtr L, int stackPos)
        {
            double ret = LuaDLL.luaL_checknumber(L, stackPos);

            return(Convert.ToByte(ret));
        }