From 23ea4f3a14d6cf2ec76567422320d0279d1d390a Mon Sep 17 00:00:00 2001 From: Jacob Shimp Date: Fri, 14 Nov 2025 20:26:21 -0500 Subject: Potential implementation of LeagueStats --- src/main/java/design/model/Match.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main/java/design/model/Match.java') diff --git a/src/main/java/design/model/Match.java b/src/main/java/design/model/Match.java index 4f01c98..8126e7c 100644 --- a/src/main/java/design/model/Match.java +++ b/src/main/java/design/model/Match.java @@ -11,22 +11,25 @@ public class Match { private final Course course; private final Date dateScheduled; private final LocalDateTime start; + private final LocalDateTime end; private final int holeCount; private final List rounds; @JsonCreator - private Match(Course course, Date dateScheduled, LocalDateTime start, int holeCount, List rounds) { + private Match(Course course, Date dateScheduled, LocalDateTime start, LocalDateTime end, int holeCount, List rounds) { this.course = course; this.dateScheduled = dateScheduled; this.start = start; + this.end = end; this.holeCount = holeCount; this.rounds = rounds; } - public Match(Course course, Date dateScheduled, LocalDateTime start, int holeCount) { + public Match(Course course, Date dateScheduled, LocalDateTime start, LocalDateTime end, int holeCount) { this.course = course; this.dateScheduled = dateScheduled; this.start = start; + this.end = end; this.holeCount = holeCount; this.rounds = new ArrayList<>(); } @@ -54,4 +57,8 @@ public class Match { public Round[] getRounds() { return rounds.toArray(Round[]::new); } + + public boolean checkCompletion() { + return LocalDateTime.now().isAfter(end); + } } -- cgit v1.2.3