Exemplo n.º 1
0
        protected IEnumerable <DTOBuffPlayer> GetRootDest(DTOBuffPack buffPack, bool homeFlag, Guid memberId, int dstDir)
        {
            if (null == buffPack)
            {
                return(null);
            }
            switch (dstDir)
            {
            case 0:    //己方全体
                var players = buffPack.GetBuffPlayers(homeFlag);
                if (null == players)
                {
                    return(null);
                }
                return(players.Values);

            case 1:    //己方场上
                var onPlayers = buffPack.GetOnBuffPlayers(homeFlag);
                if (null == onPlayers)
                {
                    return(null);
                }
                return(onPlayers);

            case 9:    //自己
                players = buffPack.GetBuffPlayers(homeFlag);
                DTOBuffPlayer player = null;
                if (players.TryGetValue(memberId, out player))
                {
                    return new DTOBuffPlayer[] { player }
                }
                ;
                return(null);

            case 10:    //对方全体
                players = buffPack.GetBuffPlayers(!homeFlag);
                if (null == players)
                {
                    return(null);
                }
                return(players.Values);

            case 11:    //对方场上
                onPlayers = buffPack.GetOnBuffPlayers(!homeFlag);
                if (null == onPlayers)
                {
                    return(null);
                }
                return(onPlayers);

            default:
                return(null);
            }
        }
Exemplo n.º 2
0
        void FillBuffPack(DTOBuffPack buffPack, bool homeFlag, Guid managerId, ArenaTeammemberFrame arenaFrame, List <TeammemberEntity> rawMembers = null, string siteId = "")
        {
            FillBuffPackRaw(buffPack, homeFlag, managerId, arenaFrame, rawMembers, siteId);
            var dicAll = buffPack.GetBuffPlayers(homeFlag);
            var lstOn  = buffPack.GetOnBuffPlayers(homeFlag);

            if (null != dicAll && null != lstOn)
            {
                return;
            }
            var members = buffPack.GetRawMembers(homeFlag);
            var pids    = buffPack.GetOnPids(homeFlag);
            var form    = buffPack.GetSolution(homeFlag);

            dicAll = new Dictionary <Guid, DTOBuffPlayer>(members.Count);
            lstOn  = new List <DTOBuffPlayer>(12);
            int             pid   = 0;
            Guid            tid   = Guid.Empty;
            DicPlayerEntity cfg   = null;
            DTOBuffPlayer   buffP = null;

            int showOrder = 1;

            foreach (var kvp in form.PlayerDic)
            {
                pid = kvp.Key;
                cfg = PlayersdicCache.Instance.GetPlayer(pid);
                if (null == cfg || !pids.TryGetValue(pid, out tid))
                {
                    throw new Exception(string.Format("BuffDataCore:Manager[{0}] Miss Player[{1}] With Config Or Member", managerId, pid));
                }
                buffP             = CreateBuffPlayer(cfg, showOrder++);
                buffP.Pos         = buffP.PosOn = kvp.Value.Position;
                buffP.ActionSkill = kvp.Value.SkillCode;
                dicAll[tid]       = buffP;
                lstOn.Add(buffP);
            }
            foreach (var kvp in members)
            {
                pid = kvp.Value.PlayerId;
                tid = kvp.Key;
                if (dicAll.ContainsKey(tid))
                {
                    continue;
                }
                cfg = PlayersdicCache.Instance.GetPlayer(pid);
                if (null == cfg)
                {
                    continue;
                }
                buffP       = CreateBuffPlayer(cfg, showOrder++, -cfg.Idx);
                dicAll[tid] = buffP;
            }
            buffPack.SetBuffPlayers(homeFlag, dicAll);
            buffPack.SetOnBuffPlayers(homeFlag, lstOn);
        }