diff options
Diffstat (limited to 'src/main/java/design/model/StrokeLeague.java')
| -rw-r--r-- | src/main/java/design/model/StrokeLeague.java | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/main/java/design/model/StrokeLeague.java b/src/main/java/design/model/StrokeLeague.java index 48889b7..57ba1aa 100644 --- a/src/main/java/design/model/StrokeLeague.java +++ b/src/main/java/design/model/StrokeLeague.java @@ -13,8 +13,8 @@ import java.util.Map; @JsonTypeName("stroke") public class StrokeLeague extends League { - private List<Golfer> participants; - private Map<Golfer, Integer> totalStrokes; + private final List<Golfer> participants; + private final Map<Golfer, Integer> totalStrokes; @JsonCreator private StrokeLeague(int id, String name, Date registrationDate, Date startDate, Date endDate, Golfer owner, List<Golfer> participants, List<Match> schedule) { @@ -31,9 +31,8 @@ public class StrokeLeague extends League { } public boolean addParticipants(Golfer g) { - boolean added = participants.add(g); - if(added) totalStrokes.putIfAbsent(g, 0); - return added; + totalStrokes.putIfAbsent(g, 0); + return participants.add(g); } public boolean removeParticipants(Golfer g) { @@ -73,15 +72,15 @@ public class StrokeLeague extends League { return getTotalStrokes(); } - @Override - public void finalizeMatch(Match match) { - getCompletedMatches().add(match); - for(int i = 0; i < participants.size(); i++){ - Golfer player = participants.get(i); - Round round = match.getRoundFor(i); - if(round != null){ - player.addRound(round); - } - } - } +// @Override +// public void finalizeMatch(Match match) { +// getCompletedMatches().add(match); +// for(int i = 0; i < participants.size(); i++){ +// Golfer player = participants.get(i); +// Round round = match.getRoundFor(i); +// if(round != null){ +// player.addRound(round); +// } +// } +// } } |
