Exemplo n.º 1
0
        /// <summary>
        /// Validates H2H Content. If its valid base on rules defined by Refereed the winer will be defined.
        /// </summary>
        /// <param name="content">The H2HContent</param>
        /// <returns>The Competitor winner with registered score</returns>
        public Competitor ValidateH2HCotent(H2HContent content)
        {
            // Here we have to validate the H2H Content based on the defined rules and Referees
            // This is just a simulation code
            var rand = new Random();
            var f    = rand.Next(0, 1001);

            content.Winner        = f % 2 == 0 ? content.First : content.Second;
            content.Winner.Score += rand.Next(1, 20);

            return(content.Winner);
        }
Exemplo n.º 2
0
        private Competitor ExecuteH2H(Competitor first, Competitor second)
        {
            H2HContent content = new H2HContent(first, second, new List <string>());

            return(this.ValidateH2HCotent(content));
        }