Beispiel #1
0
    static int RegisterFunc(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 4);
        IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
        string arg1 = LuaScriptMgr.GetLuaString(L, 2);

        LuaInterface.LuaCSFunction arg2 = LuaScriptMgr.GetNetObject <LuaInterface.LuaCSFunction>(L, 3);
        string arg3 = LuaScriptMgr.GetLuaString(L, 4);

        LuaScriptMgr.RegisterFunc(arg0, arg1, arg2, arg3);
        return(0);
    }
Beispiel #2
0
    static int Push(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        Type[] types0 = { typeof(IntPtr), typeof(LuaInterface.LuaTable) };
        Type[] types1 = { typeof(IntPtr), typeof(LuaInterface.ILuaGeneratedType) };
        Type[] types2 = { typeof(IntPtr), typeof(LuaInterface.LuaCSFunction) };
        Type[] types3 = { typeof(IntPtr), typeof(LuaInterface.LuaFunction) };
        Type[] types4 = { typeof(IntPtr), typeof(IntPtr) };
        Type[] types5 = { typeof(IntPtr), typeof(Object) };
        Type[] types6 = { typeof(IntPtr), typeof(Type) };
        Type[] types7 = { typeof(IntPtr), typeof(double) };
        Type[] types8 = { typeof(IntPtr), typeof(string) };

        if (count == 2 && LuaScriptMgr.CheckTypes(L, types0, 1))
        {
            IntPtr   arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            LuaTable arg1 = LuaScriptMgr.GetLuaTable(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types1, 1))
        {
            IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            LuaInterface.ILuaGeneratedType arg1 = LuaScriptMgr.GetNetObject <LuaInterface.ILuaGeneratedType>(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types2, 1))
        {
            IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            LuaInterface.LuaCSFunction arg1 = LuaScriptMgr.GetNetObject <LuaInterface.LuaCSFunction>(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types3, 1))
        {
            IntPtr      arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            LuaFunction arg1 = LuaScriptMgr.GetLuaFunction(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types4, 1))
        {
            IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            IntPtr arg1 = (IntPtr)LuaScriptMgr.GetNumber(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types5, 1))
        {
            IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            Object arg1 = LuaScriptMgr.GetNetObject <Object>(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types6, 1))
        {
            IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            Type   arg1 = LuaScriptMgr.GetTypeObject(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types7, 1))
        {
            IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            double arg1 = (double)LuaScriptMgr.GetNumber(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types8, 1))
        {
            IntPtr arg0 = (IntPtr)LuaScriptMgr.GetNumber(L, 1);
            string arg1 = LuaScriptMgr.GetString(L, 2);
            LuaScriptMgr.Push(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: LuaScriptMgr.Push");
        }

        return(0);
    }