Beispiel #1
0
        static int _m_Then(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                KEngine.KAsync gen_to_be_invoked = (KEngine.KAsync)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <System.Action>(L, 2))
                {
                    System.Action _callback = translator.GetDelegate <System.Action>(L, 2);

                    KEngine.KAsync gen_ret = gen_to_be_invoked.Then(_callback);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <KEngine.KAsync.AsyncThenDelegate>(L, 2))
                {
                    KEngine.KAsync.AsyncThenDelegate _thenFunc = translator.GetDelegate <KEngine.KAsync.AsyncThenDelegate>(L, 2);

                    KEngine.KAsync gen_ret = gen_to_be_invoked.Then(_thenFunc);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <KEngine.KAsync.AsyncThenDelegateEasy>(L, 2))
                {
                    KEngine.KAsync.AsyncThenDelegateEasy _thenFunc = translator.GetDelegate <KEngine.KAsync.AsyncThenDelegateEasy>(L, 2);

                    KEngine.KAsync gen_ret = gen_to_be_invoked.Then(_thenFunc);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to KEngine.KAsync.Then!"));
        }
Beispiel #2
0
        static int _m_Start_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 0)
                {
                    KEngine.KAsync gen_ret = KEngine.KAsync.Start(  );
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 1 && translator.Assignable <System.Action>(L, 1))
                {
                    System.Action _callback = translator.GetDelegate <System.Action>(L, 1);

                    KEngine.KAsync gen_ret = KEngine.KAsync.Start(_callback);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 1 && translator.Assignable <KEngine.KAsync.AsyncThenDelegateEasy>(L, 1))
                {
                    KEngine.KAsync.AsyncThenDelegateEasy _callback = translator.GetDelegate <KEngine.KAsync.AsyncThenDelegateEasy>(L, 1);

                    KEngine.KAsync gen_ret = KEngine.KAsync.Start(_callback);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to KEngine.KAsync.Start!"));
        }