コード例 #1
0
        private static void ConfirmNewStartDateTimeCompliesWithGroupRules(Match match, DateTime newStartDateTime)
        {
            bool newStartDateTimeDoesNotComplyWithGroupRules = !match.Group.NewDateTimeIsValid(match, newStartDateTime);

            if (newStartDateTimeDoesNotComplyWithGroupRules)
            {
                TournamentIssueReporter tournamentIssueReporter = match.Group.Round.Tournament.TournamentIssueReporter;
                tournamentIssueReporter.Report(match, TournamentIssues.StartDateTimeIncompatibleWithGroupRules);
            }
        }
コード例 #2
0
        private static bool ConfirmNewStartDateTimeIsFutureDateTime(Match match, DateTime newStartDateTime)
        {
            bool newStartDateTimeIsInThePast = newStartDateTime < SystemTime.Now;

            if (newStartDateTimeIsInThePast)
            {
                TournamentIssueReporter tournamentIssueReporter = match.Group.Round.Tournament.TournamentIssueReporter;
                tournamentIssueReporter.Report(match, TournamentIssues.StartDateTimeIsInThePast);
                return(false);
            }

            return(true);
        }
コード例 #3
0
        private static void ConfirmNewStartDateTimeIsAfterAnyMatchInPreviousRound(Match match, DateTime newStartDateTime)
        {
            RoundBase previousRound      = match.Group.Round.GetPreviousRound();
            bool      previousRoundExist = previousRound != null;

            if (previousRoundExist)
            {
                bool newStartDateTimeIsEarlierThanMatchInPreviousRound = newStartDateTime < previousRound.GetLastMatch().StartDateTime;

                if (newStartDateTimeIsEarlierThanMatchInPreviousRound)
                {
                    TournamentIssueReporter tournamentIssueReporter = match.Group.Round.Tournament.TournamentIssueReporter;
                    tournamentIssueReporter.Report(match, TournamentIssues.StartDateTimeIncompatibleWithPreviousRound);
                }
            }
        }