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); } }
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); }
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); } } }