LuaInterface.LuaDLL.lua_pushboolean C# (CSharp) Method

lua_pushboolean() public static method

public static lua_pushboolean ( IntPtr luaState, bool value ) : void
luaState System.IntPtr
value bool
return void
        public static void lua_pushboolean(IntPtr luaState, bool value)
        {
            LuaDLLWrapper.lua_pushboolean(luaState, value ? 1 : 0);
        }

Usage Example

示例#1
0
        public Lua(bool enableLengthWorkaround)
        {
            // NOTE: You should enable the length workaround on Mac and Linux
            this.enableLengthWorkaround = enableLengthWorkaround;

            luaState = LuaDLL.luaL_newstate();  // steffenj: Lua 5.1.1 API change (lua_open is gone)

            // Load libraries
            LuaDLL.luaL_openlibs(luaState);

            // Add LuaInterface marker
            LuaDLL.lua_pushstring(luaState, "LUAINTERFACE LOADED");
            LuaDLL.lua_pushboolean(luaState, true);
            LuaDLL.lua_settable(luaState, (int)LuaIndexes.LUA_REGISTRYINDEX);

            translator = new ObjectTranslator(this, luaState);

            tracebackFunction = new LuaCSFunction(traceback);

            // We need to keep this in a managed reference so the delegate doesn't get garbage collected
            panicCallback = new LuaFunctionCallback(PanicCallback);
            LuaDLL.lua_atpanic(luaState, panicCallback);
        }
All Usage Examples Of LuaInterface.LuaDLL::lua_pushboolean
LuaDLL