Example #1
0
        /// <summary>Gets an object from the Lua stack with the desired type, if it matches, otherwise returns null.</summary>
        internal object getAsType(lua.State L, int index, Type paramType)
        {
            Debug.Assert(interpreter.IsSameLua(L));
            ExtractValue extractor = typeChecker.checkType(L, index, paramType);

            if (extractor == null)
            {
                return(null);
            }
            return(extractor(L, index));
        }
Example #2
0
        /*
         * Gets an object from the Lua stack with the desired type, if it matches, otherwise
         * returns null.
         */
        internal object getAsType(IntPtr luaState, int stackPos, Type paramType)
        {
            ExtractValue extractor = typeChecker.checkType(luaState, stackPos, paramType);

            if (extractor != null)
            {
                return(extractor(luaState, stackPos));
            }
            return(null);
        }
Example #3
0
        /*
         * Gets an object from the Lua stack with the desired type, if it matches, otherwise
         * returns null.
         */
        internal object getAsType(LuaCore.lua_State luaState, int stackPos, Type paramType)
        {
            var extractor = typeChecker.checkType(luaState, stackPos, paramType);

            return(!extractor.IsNull() ? extractor(luaState, stackPos) : null);
        }