Example #1
0
 /// <summary>
 /// Assigns a winner and a loser from 2 challengers
 /// </summary>
 /// <param name="challengerX">The first challenger</param>
 /// <param name="challengerY">The second challenger</param>
 public void ManageResults(Challenger challengerX, Challenger challengerY)
 {
     //assigning the winner
     Winner = Challenger.Winner(challengerX, challengerY);
     //assigning the loser
     Loser = Challenger.Loser(challengerX, challengerY);
 }
Example #2
0
        /// <summary>
        /// The default constructor asks for the first challenger and the second challenger of the match
        /// </summary>
        /// <param name="challengerX">The challenger1 of the match</param>
        /// <param name="challengerY">The challenger2 of the match</param>
        public Match(Challenger challengerX, Challenger challengerY)
        {
            if (challengerX == null || challengerY == null)
            {
                throw new ChallengerException("Challengers CANNOT be null", new ArgumentNullException());
            }

            ChallengerX = challengerX;
            ChallengerY = challengerY;
        }
        /// <summary>
        /// Creates and manages the last match in the tournament between the two challengers left from each group.
        /// </summary>
        private void ManageTounamentFinalMatch()
        {
            Challenger group1Winner = Group1.Winner;
            Challenger group2Winner = Group2.Winner;
            Match      finalMatch   = new Match(group1Winner, group2Winner);

            finalMatch.Start();
            Winner      = finalMatch.Winner;
            _finalMatch = finalMatch;
        }
Example #4
0
 /// <summary>
 /// Generates 2 random numbers and assign each one to the point property for the challengers arguments provided
 /// </summary>
 /// <param name="challengerX">The First challenger</param>
 /// <param name="challengerY">The Second challenger</param>
 public void GenerateAndAssignPoints(Challenger challengerX, Challenger challengerY)
 {
     Troschuetz.Random.Generators.StandardGenerator generator = new Troschuetz.Random.Generators.StandardGenerator();
     challengerX.Points = generator.Next();
     challengerY.Points = generator.Next();
 }