/// <summary>
        /// Validates the specified gates.
        /// </summary>
        /// <param name="contestTaskToValidate">The contest task to validate.</param>
        /// <returns></returns>
        public override bool ValidateTask(RoundScoreBase contestTaskToValidate)
        {
            if (contestTaskToValidate.TimeGates == null)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Count > 5)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Any(x => x.Time.TotalSeconds < 0))
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Sum(x => x.Time.TotalSeconds) > 600)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Any(x => x.Time > TimeSpan.FromSeconds(120)))
            {
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Validates the specified gates.
        /// </summary>
        /// <param name="contestTaskToValidate">The contest task to validate.</param>
        /// <returns></returns>
        public override bool ValidateTask(RoundScoreBase contestTaskToValidate)
        {
            if (contestTaskToValidate.TimeGates == null)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Count > 5)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Sum(x => x.Time.TotalSeconds) > 600)
            {
                return(false);
            }

            for (var i = 0; i < 5; ++i)
            {
                var time = contestTaskToValidate.TimeGates[i]?.Time.TotalSeconds ?? 0;
                if (time > 60 + (i * 30))
                {
                    return(false);
                }
            }

            return(true);
        }
        /// <summary>
        /// Validates the specified gates.
        /// </summary>
        /// <param name="contestTaskToValidate">The contest task to validate.</param>
        /// <returns></returns>
        public override bool ValidateTask(RoundScoreBase contestTaskToValidate)
        {
            if (contestTaskToValidate.TimeGates == null)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Count() > 7)
            {
                return(false);
            }

            var properGate = contestTaskToValidate.TimeGates.Where(x => x.Time == TimeSpan.FromSeconds(120));

            if (properGate == null || properGate.Count() != 1)
            {
                return(false);
            }

            properGate = contestTaskToValidate.TimeGates.Where(x => x.Time == TimeSpan.FromSeconds(105));
            if (properGate == null || properGate.Count() != 1)
            {
                return(false);
            }

            properGate = contestTaskToValidate.TimeGates.Where(x => x.Time == TimeSpan.FromSeconds(90));
            if (properGate == null || properGate.Count() != 1)
            {
                return(false);
            }

            properGate = contestTaskToValidate.TimeGates.Where(x => x.Time == TimeSpan.FromSeconds(75));
            if (properGate == null || properGate.Count() != 1)
            {
                return(false);
            }

            properGate = contestTaskToValidate.TimeGates.Where(x => x.Time == TimeSpan.FromSeconds(60));
            if (properGate == null || properGate.Count() != 1)
            {
                return(false);
            }

            properGate = contestTaskToValidate.TimeGates.Where(x => x.Time == TimeSpan.FromSeconds(45));
            if (properGate == null || properGate.Count() != 1)
            {
                return(false);
            }

            properGate = contestTaskToValidate.TimeGates.Where(x => x.Time == TimeSpan.FromSeconds(30));
            if (properGate == null || properGate.Count() != 1)
            {
                return(false);
            }

            return(true);
        }
Пример #4
0
        /// <summary>
        /// Validates the specified gates.
        /// </summary>
        /// <param name="contestTaskToValidate">The contest task to validate.</param>
        /// <returns></returns>
        public override bool ValidateTask(RoundScoreBase contestTaskToValidate)
        {
            if (contestTaskToValidate.TimeGates == null)
            {
                return(false);
            }

            // Cannot exceed 10 minutes... Now, some would say that you can't exceed 9:58 seconds
            // but I'm not going to make that declaration here :).
            if (contestTaskToValidate.TimeGates.Sum(x => x.Time.TotalSeconds) > 600)
            {
                return(false);
            }

            return(true);
        }
Пример #5
0
        /// <summary>
        /// Validates the specified gates.
        /// </summary>
        /// <param name="contestTaskToValidate">The contest task to validate.</param>
        /// <returns></returns>
        public override bool ValidateTask(RoundScoreBase contestTaskToValidate)
        {
            if (contestTaskToValidate.TimeGates == null)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Count() != numberOfFlights)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Any(x => x.Time > TimeSpan.FromMinutes(3)))
            {
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Validates the specified gates.
        /// </summary>
        /// <param name="contestTaskToValidate">The contest task to validate.</param>
        /// <returns></returns>
        public override bool ValidateTask(RoundScoreBase contestTaskToValidate)
        {
            if (contestTaskToValidate.TimeGates == null)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Count != NumberOfTimeGatesAllowed)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Any(x => x.Time > TimeSpan.FromMinutes(5)))
            {
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Validates the specified gates.
        /// </summary>
        /// <param name="contestTaskToValidate">The contest task to validate.</param>
        /// <returns></returns>
        public override bool ValidateTask(RoundScoreBase contestTaskToValidate)
        {
            if (contestTaskToValidate.TimeGates == null)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Sum(g => g.Time.TotalSeconds) > TimeSpan.FromMinutes(10).TotalSeconds)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Count() > 4)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Any(g => g.Time > TimeSpan.FromMinutes(4)))
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Where(g => g.Time > TimeSpan.FromMinutes(3)).Count() > 1)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Where(g => g.Time > TimeSpan.FromMinutes(2)).Count() > 2)
            {
                return(false);
            }

            if (contestTaskToValidate.TimeGates.Where(g => g.Time > TimeSpan.FromMinutes(1)).Count() > 3)
            {
                return(false);
            }

            return(true);
        }
 /// <summary>Scores the task.
 /// </summary>
 /// <param name="gates">The gates.</param>
 /// <returns></returns>
 public override double ScoreTask(RoundScoreBase contestTaskToScore) => contestTaskToScore.TimeGates.Sum(x => x.Time.TotalSeconds);
Пример #9
0
 /// <summary>
 /// Validates the specified gates.
 /// </summary>
 /// <param name="contestTaskToValidate">The contest task to validate.</param>
 /// <returns></returns>
 /// <exception cref="NotImplementedException"></exception>
 public virtual bool ValidateTask(RoundScoreBase contestTaskToValidate)
 {
     throw new NotImplementedException();
 }
Пример #10
0
 /// <summary>
 /// Scores the task.
 /// </summary>
 /// <param name="contestTaskToScore">The contest task to score.</param>
 /// <returns></returns>
 /// <exception cref="NotImplementedException"></exception>
 public virtual double ScoreTask(RoundScoreBase contestTaskToScore)
 {
     throw new NotImplementedException();
 }