ActivEarth.Server.Service.Competition.ContestManager.CalculateEstimatedLengthInDays C# (CSharp) Метод

CalculateEstimatedLengthInDays() приватный статический Метод

Returns the length of a contest of a time-based contest, and estimates the length of a goal-based contest.
private static CalculateEstimatedLengthInDays ( Contest contest ) : int
contest ActivEarth.Objects.Competition.Contests.Contest Contest to calculate the length of.
Результат int
        private static int CalculateEstimatedLengthInDays(Contest contest)
        {
            if (contest.Mode == ContestEndMode.TimeBased)
            {
                return contest.EndTime.Value.Subtract(contest.StartTime).Days;
            }
            else // ContestEndMode.GoalBased
            {
                List<float> expectedPerDay = new List<float> { 7000, 2, 4, 1, 0.6f, 1, 7, 1.25f, 0.5f, 0.5f, 0.25f  };
                return (int)Math.Round(contest.EndValue.Value / expectedPerDay[(int)contest.StatisticBinding]);
            }
        }