コード例 #1
0
    public static void ParseCoupleMapFromDB(string raw, ref List <Couple> result)
    {
        if (result == null)
        {
            result = new List <Couple>();
        }

        Match match = Regex.Match(raw, @"\{(\d+)[\,\s]*(\d+)\}");

        while (match.Success)
        {
            var needNumber = match.Groups[2].Captures;
            var needId     = match.Groups[1].Captures;

            Couple couple = Couple.Make(needId[0].Value, needNumber[0].Value);
            result.Add(couple);

            match = match.NextMatch();
        }
    }
コード例 #2
0
        static int _m_Make_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 1 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
                {
                    string raw = LuaAPI.lua_tostring(L, 1);

                    Couple __cl_gen_ret = Couple.Make(raw);
                    translator.Push(L, __cl_gen_ret);



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

                    Couple __cl_gen_ret = Couple.Make(rawA, rawB);
                    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 Couple.Make!"));
        }