Exemplo n.º 1
0
        private ArenaPartyCreation TryCreateBalancedTeam(ArenaParty party, ref List <ArenaParty> p2, ref List <Character> characters)
        {
            var i            = 0;
            var searchedRank = -1;

            ArenaPartyCreation creation;

            while (p2.Count > i && !this.CanBeBalanced(party, p2[i], ref searchedRank))
            {
                ++i;
            }

            if (i < p2.Count)
            {
                var character = characters.FirstOrDefault(entry => Math.Abs(entry.Record.HiddenArenaRank - searchedRank) < 150);
                if (character == null)
                {
                    creation = null;
                }
                else
                {
                    creation = new ArenaPartyCreation(p2[i], character);

                    p2.Remove(p2[i]);
                    characters.Remove(character);
                }
            }
            else
            {
                creation = null;
            }

            return(creation);
        }
Exemplo n.º 2
0
        private bool CanArena(WorldClient client, ArenaParty party)
        {
            bool result;

            result = true; // TODO

            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Check if the fight between p3 and p2 can be balanced. If is true, the method calculate the best desired rank for the last player.
        /// </summary>
        /// <param name="p3"></param>
        /// <param name="p2"></param>
        /// <param name="bestRank"></param>
        /// <returns></returns>
        private bool CanBeBalanced(ArenaParty p3, ArenaParty p2, ref int bestRank)
        {
            bool result;

            var orderedP3 = p3.Members.OrderByDescending(entry => entry.Record.HiddenArenaRank);
            var orderedP2 = p2.Members.OrderByDescending(entry => entry.Record.HiddenArenaRank);

            result = false; // TODO

            return(result);
        }
Exemplo n.º 4
0
 public ArenaPartyCreation(params Character[] characters)
 {
     this.m_characters = new List <Character>();
     this.m_characters.AddRange(characters);
     this.m_party = null;
 }
Exemplo n.º 5
0
        // PROPERTIES

        // CONSTRUCTORS
        public ArenaPartyCreation(ArenaParty party)
        {
            this.m_characters = new List <Character>();
            this.m_party      = party;
        }
Exemplo n.º 6
0
 public bool IsInQueue(ArenaParty party)
 {
     return(false);
 }