Ejemplo n.º 1
0
        static int _m_Handle(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.IEvent gen_to_be_invoked = (DCET.Model.IEvent)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1)
                {
                    gen_to_be_invoked.Handle(  );



                    return(0);
                }
                if (gen_param_count == 2 && translator.Assignable <object>(L, 2))
                {
                    object _a = translator.GetObject(L, 2, typeof(object));

                    gen_to_be_invoked.Handle(_a);



                    return(0);
                }
                if (gen_param_count == 3 && translator.Assignable <object>(L, 2) && translator.Assignable <object>(L, 3))
                {
                    object _a = translator.GetObject(L, 2, typeof(object));
                    object _b = translator.GetObject(L, 3, typeof(object));

                    gen_to_be_invoked.Handle(_a, _b);



                    return(0);
                }
                if (gen_param_count == 4 && translator.Assignable <object>(L, 2) && translator.Assignable <object>(L, 3) && translator.Assignable <object>(L, 4))
                {
                    object _a = translator.GetObject(L, 2, typeof(object));
                    object _b = translator.GetObject(L, 3, typeof(object));
                    object _c = translator.GetObject(L, 4, typeof(object));

                    gen_to_be_invoked.Handle(_a, _b, _c);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to DCET.Model.IEvent.Handle!"));
        }
Ejemplo n.º 2
0
        static int _m_RegisterEvent(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.EventSystem gen_to_be_invoked = (DCET.Model.EventSystem)translator.FastGetCSObj(L, 1);



                {
                    string            _eventId = LuaAPI.lua_tostring(L, 2);
                    DCET.Model.IEvent _e       = (DCET.Model.IEvent)translator.GetObject(L, 3, typeof(DCET.Model.IEvent));

                    gen_to_be_invoked.RegisterEvent(_eventId, _e);



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