static int ComplexFunc(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


            try {
                {
                    Tutorial.Param1 p1; translator.Get(L, 2, out p1);
                    int             p2 = LuaAPI.xlua_tointeger(L, 3);
                    string          p3;
                    System.Action   luafunc = translator.GetDelegate <System.Action>(L, 4);
                    System.Action   csfunc;

                    double __cl_gen_ret = __cl_gen_to_be_invoked.ComplexFunc(p1, ref p2, out p3, luafunc, out csfunc);
                    LuaAPI.lua_pushnumber(L, __cl_gen_ret);
                    LuaAPI.xlua_pushinteger(L, p2);

                    LuaAPI.lua_pushstring(L, p3);

                    translator.Push(L, csfunc);



                    return(4);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_ComplexFunc(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Tutorial.DrivenClass gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);



                {
                    Tutorial.Param1 _p1; translator.Get(L, 2, out _p1);
                    int             _p2 = LuaAPI.xlua_tointeger(L, 3);
                    string          _p3;
                    System.Action   _luafunc = translator.GetDelegate <System.Action>(L, 4);
                    System.Action   _csfunc;

                    double gen_ret = gen_to_be_invoked.ComplexFunc(_p1, ref _p2, out _p3, _luafunc, out _csfunc);
                    LuaAPI.lua_pushnumber(L, gen_ret);
                    LuaAPI.xlua_pushinteger(L, _p2);

                    LuaAPI.lua_pushstring(L, _p3);

                    translator.Push(L, _csfunc);



                    return(4);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Esempio n. 3
0
        public static DrivenClass operator +(DrivenClass a, DrivenClass b)
        {
            DrivenClass ret = new DrivenClass();

            ret.DMF = a.DMF + b.DMF;
            return(ret);
        }
Esempio n. 4
0
        static int _e_TestEvent(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                int __gen_param_count       = LuaAPI.lua_gettop(L);
                Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);
                System.Action        __gen_delegate         = translator.GetDelegate <System.Action>(L, 3);
                if (__gen_delegate == null)
                {
                    return(LuaAPI.luaL_error(L, "#3 need System.Action!"));
                }

                if (__gen_param_count == 3)
                {
                    if (LuaAPI.xlua_is_eq_str(L, 2, "+"))
                    {
                        __cl_gen_to_be_invoked.TestEvent += __gen_delegate;
                        return(0);
                    }


                    if (LuaAPI.xlua_is_eq_str(L, 2, "-"))
                    {
                        __cl_gen_to_be_invoked.TestEvent -= __gen_delegate;
                        return(0);
                    }
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DrivenClass.TestEvent!");
            return(0);
        }
        static int DefaultValueFunc(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING))
                {
                    int    a = LuaAPI.xlua_tointeger(L, 2);
                    string b = LuaAPI.lua_tostring(L, 3);
                    string c = LuaAPI.lua_tostring(L, 4);

                    __cl_gen_to_be_invoked.DefaultValueFunc(a, b, c);



                    return(0);
                }
                if (__gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
                {
                    int    a = LuaAPI.xlua_tointeger(L, 2);
                    string b = LuaAPI.lua_tostring(L, 3);

                    __cl_gen_to_be_invoked.DefaultValueFunc(a, b);



                    return(0);
                }
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int a = LuaAPI.xlua_tointeger(L, 2);

                    __cl_gen_to_be_invoked.DefaultValueFunc(a);



                    return(0);
                }
                if (__gen_param_count == 1)
                {
                    __cl_gen_to_be_invoked.DefaultValueFunc(  );



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

            return(LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DrivenClass.DefaultValueFunc!"));
        }
        static int _g_get_DMF(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Tutorial.DrivenClass gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.DMF);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Esempio n. 7
0
        static int _g_get_TestDelegate(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);
                translator.Push(L, __cl_gen_to_be_invoked.TestDelegate);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
        static int set_TestDelegate(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.TestDelegate = translator.GetDelegate <System.Action <string> >(L, 2);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
        static int set_DMF(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.DMF = LuaAPI.xlua_tointeger(L, 2);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    Tutorial.DrivenClass __cl_gen_ret = new Tutorial.DrivenClass();
                    translator.Push(L, __cl_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 Tutorial.DrivenClass constructor!"));
        }
        static int TestEvent(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            int __gen_param_count       = LuaAPI.lua_gettop(L);

            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);
            try {
                System.Action __gen_delegate = translator.GetDelegate <System.Action>(L, 3);
                if (__gen_delegate == null)
                {
                    return(LuaAPI.luaL_error(L, "#3 need System.Action!"));
                }

                if (__gen_param_count == 3)
                {
                    System.IntPtr strlen;

                    System.IntPtr str = LuaAPI.lua_tolstring(L, 2, out strlen);

                    if (str != System.IntPtr.Zero && strlen.ToInt32() == 1)
                    {
                        byte op = System.Runtime.InteropServices.Marshal.ReadByte(str);


                        if (op == (byte)'+')
                        {
                            __cl_gen_to_be_invoked.TestEvent += __gen_delegate;
                            return(0);
                        }


                        if (op == (byte)'-')
                        {
                            __cl_gen_to_be_invoked.TestEvent -= __gen_delegate;
                            return(0);
                        }
                    }
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DrivenClass.TestEvent!");
            return(0);
        }
        static int GenericMethodOfString(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


            try {
                {
                    __cl_gen_to_be_invoked.GenericMethodOfString(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int GetSomeData(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


            try {
                {
                    int __cl_gen_ret = __cl_gen_to_be_invoked.GetSomeData(  );
                    LuaAPI.xlua_pushinteger(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_CallEvent(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Tutorial.DrivenClass gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.CallEvent(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int __AddMeta(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (translator.Assignable <Tutorial.DrivenClass>(L, 1) && translator.Assignable <Tutorial.DrivenClass>(L, 2))
                {
                    Tutorial.DrivenClass leftside  = (Tutorial.DrivenClass)translator.GetObject(L, 1, typeof(Tutorial.DrivenClass));
                    Tutorial.DrivenClass rightside = (Tutorial.DrivenClass)translator.GetObject(L, 2, typeof(Tutorial.DrivenClass));

                    translator.Push(L, leftside + rightside);

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

            return(LuaAPI.luaL_error(L, "invalid arguments to right hand of + operator, need Tutorial.DrivenClass!"));
        }
Esempio n. 16
0
        static int _m_GetCalc(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);



                {
                    Tutorial.Calc __cl_gen_ret = __cl_gen_to_be_invoked.GetCalc(  );
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int TestLong(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


            try {
                {
                    long n = LuaAPI.lua_toint64(L, 2);

                    ulong __cl_gen_ret = __cl_gen_to_be_invoked.TestLong(n);
                    LuaAPI.lua_pushuint64(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int VariableParamsFunc(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


            try {
                {
                    int      a    = LuaAPI.xlua_tointeger(L, 2);
                    string[] strs = translator.GetParams <string>(L, 3);

                    __cl_gen_to_be_invoked.VariableParamsFunc(a, strs);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int EnumTestFunc(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


            try {
                {
                    Tutorial.TestEnum e; translator.Get(L, 2, out e);

                    Tutorial.TestEnum __cl_gen_ret = __cl_gen_to_be_invoked.EnumTestFunc(e);
                    translator.PushTutorialTestEnum(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Esempio n. 20
0
        static int _m_TestFunc(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Tutorial.DrivenClass __cl_gen_to_be_invoked = (Tutorial.DrivenClass)translator.FastGetCSObj(L, 1);


                int __gen_param_count = LuaAPI.lua_gettop(L);

                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int i = LuaAPI.xlua_tointeger(L, 2);

                    __cl_gen_to_be_invoked.TestFunc(i);



                    return(0);
                }
                if (__gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string i = LuaAPI.lua_tostring(L, 2);

                    __cl_gen_to_be_invoked.TestFunc(i);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DrivenClass.TestFunc!"));
        }
Esempio n. 21
0
 public static void GenericMethodOfString(this DrivenClass obj)
 {
     obj.GenericMethod <string>();
 }
Esempio n. 22
0
 public static int GetSomeData(this DrivenClass obj)
 {
     Debug.Log("GetSomeData ret = " + obj.DMF);
     return(obj.DMF);
 }
Esempio n. 23
0
 public static DrivenClass operator +(DrivenClass a, DrivenClass b)
 {
     DrivenClass ret = new DrivenClass();
     ret.DMF = a.DMF + b.DMF;
     return ret;
 }