コード例 #1
0
    static int _CreateExerciseInfo(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            fogs.proto.msg.ExerciseInfo obj = new fogs.proto.msg.ExerciseInfo();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: fogs.proto.msg.ExerciseInfo.New");
        }

        return(0);
    }
コード例 #2
0
    static int get_star(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        fogs.proto.msg.ExerciseInfo obj = (fogs.proto.msg.ExerciseInfo)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name star");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index star on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj.star);
        return(1);
    }
コード例 #3
0
    static int set_quality(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        fogs.proto.msg.ExerciseInfo obj = (fogs.proto.msg.ExerciseInfo)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name quality");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index quality on a nil value");
            }
        }

        obj.quality = (uint)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }