예제 #1
0
        public ITournMatchArray GetPairedDown(int round)
        {
            TournMatchArray tournMatchArray = new TournMatchArray();

            foreach (ITournMatch match in (IEnumerable <ITournMatch>) this.GetByRound(round))
            {
                if (match.Players.HasPlayer(Player.BYE_ID))
                {
                    tournMatchArray.AddMatch(match);
                }
                else if (match.Players[0].Tie1_Wins != match.Players[1].Tie1_Wins)
                {
                    tournMatchArray.AddMatch(match);
                }
            }
            return((ITournMatchArray)tournMatchArray);
        }
예제 #2
0
        public void Randomize()
        {
            TournMatchArray tournMatchArray = new TournMatchArray();

            while (this.Count > 0)
            {
                int index = Common.RandomGenerator.Next(this.Count - 1);
                tournMatchArray.AddMatch(this[index]);
                this.RemoveAt(index);
            }
            this.Append((ITournMatchArray)tournMatchArray);
        }
예제 #3
0
        public ITournMatchArray GetByPlayer(long PlayerId)
        {
            TournMatchArray tournMatchArray = new TournMatchArray();

            foreach (TournMatch tournMatch in (List <ITournMatch>) this)
            {
                if (tournMatch.Players.HasPlayer(PlayerId))
                {
                    tournMatchArray.AddMatch((ITournMatch)tournMatch);
                }
            }
            return((ITournMatchArray)tournMatchArray);
        }
예제 #4
0
        public ITournMatchArray GetByPoints(int round, int highPoint, int lowPoint)
        {
            TournMatchArray tournMatchArray = new TournMatchArray();

            foreach (TournMatch tournMatch in (List <ITournMatch>) this)
            {
                if (tournMatch.Points <= highPoint && tournMatch.Points >= lowPoint && tournMatch.Round == round)
                {
                    tournMatchArray.AddMatch((ITournMatch)tournMatch);
                }
            }
            return((ITournMatchArray)tournMatchArray);
        }
예제 #5
0
        public ITournMatchArray GetByRound(
            int highRound,
            int lowRound,
            bool hideCompleted)
        {
            TournMatchArray tournMatchArray = new TournMatchArray();

            foreach (TournMatch tournMatch in (List <ITournMatch>) this)
            {
                if (tournMatch.Round >= lowRound && tournMatch.Round <= highRound && (tournMatch.Status == TournMatchResult.Incomplete || !hideCompleted))
                {
                    tournMatchArray.AddMatch((ITournMatch)tournMatch);
                }
            }
            return((ITournMatchArray)tournMatchArray);
        }