Beispiel #1
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    byte[] _bytes = LuaAPI.lua_tobytes(L, 2);

                    PF.Guid gen_ret = new PF.Guid(_bytes);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _str = LuaAPI.lua_tostring(L, 2);

                    PF.Guid gen_ret = new PF.Guid(_str);
                    translator.Push(L, gen_ret);

                    return(1);
                }

                if (LuaAPI.lua_gettop(L) == 1)
                {
                    translator.Push(L, default(PF.Guid));
                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to PF.Guid constructor!"));
        }
Beispiel #2
0
        static int _m_NewGuid_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    PF.Guid gen_ret = PF.Guid.NewGuid(  );
                    translator.Push(L, gen_ret);



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



                {
                    string _input = LuaAPI.lua_tostring(L, 1);

                    PF.Guid gen_ret = PF.Guid.Parse(_input);
                    translator.Push(L, gen_ret);



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