diff options
| author | WillemDalton <willemhdalton@gmail.com> | 2025-11-16 15:06:41 -0500 |
|---|---|---|
| committer | WillemDalton <willemhdalton@gmail.com> | 2025-11-16 15:06:41 -0500 |
| commit | af9f559a2ee427905c39363643bac2e7878fb10c (patch) | |
| tree | 7560487fc77ca78d09e79c6d981c6a522f637899 | |
| parent | 46f827ea8cc5bb925bbe13694f8e6317d36eff5c (diff) | |
| download | designproject-design-6-af9f559a2ee427905c39363643bac2e7878fb10c.tar.gz designproject-design-6-af9f559a2ee427905c39363643bac2e7878fb10c.tar.bz2 designproject-design-6-af9f559a2ee427905c39363643bac2e7878fb10c.zip | |
fixed guests viewing courses
Diffstat (limited to '')
| -rw-r--r-- | .vscode/settings.json | 3 | ||||
| -rw-r--r-- | data/personaldb.json | 32 | ||||
| -rw-r--r-- | src/main/java/design/controller/userinput/menus/CourseSearch.java | 4 |
3 files changed, 32 insertions, 7 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index e0f15db..9bd06c2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "java.configuration.updateBuildConfiguration": "automatic" + "java.configuration.updateBuildConfiguration": "automatic", + "java.debug.settings.onBuildFailureProceed": true }
\ No newline at end of file diff --git a/data/personaldb.json b/data/personaldb.json index 3a08057..2aa4ec7 100644 --- a/data/personaldb.json +++ b/data/personaldb.json @@ -1,5 +1,19 @@ [ { + "clubs": [], + "nextClubId": 1, + "username": "test", + "passwordHash": 3556498, + "fullName": "test", + "courses": [ + 999 + ], + "rounds": [], + "invites": [], + "joinedTeam": null, + "team": null + }, + { "clubs": [ { "id": 1, @@ -81,12 +95,12 @@ } ], "currentHoleIndex": 2, - "totalDistance": 1108.0, "currentHole": { "number": 3, "par": 4 }, - "totalSwings": 5 + "totalSwings": 5, + "totalDistance": 1108.0 }, { "course": 1, @@ -117,14 +131,17 @@ } ], "currentHoleIndex": 9, - "totalDistance": 204.0, "currentHole": { "number": 10, "par": 3 }, - "totalSwings": 1 + "totalSwings": 1, + "totalDistance": 204.0 } - ] + ], + "invites": [], + "joinedTeam": null, + "team": null }, { "clubs": [], @@ -133,6 +150,9 @@ "passwordHash": 389416948, "fullName": "tyler f", "courses": [], - "rounds": [] + "rounds": [], + "invites": [], + "joinedTeam": null, + "team": null } ]
\ No newline at end of file diff --git a/src/main/java/design/controller/userinput/menus/CourseSearch.java b/src/main/java/design/controller/userinput/menus/CourseSearch.java index 4dd2cad..8fd1963 100644 --- a/src/main/java/design/controller/userinput/menus/CourseSearch.java +++ b/src/main/java/design/controller/userinput/menus/CourseSearch.java @@ -80,6 +80,10 @@ public class CourseSearch extends Menu { var name = String.format("%s, %s, Difficulty: %s, %s holes, %s total par", c.getName(), c.getLocation(), c.getDifficultyRating(), c.getHoleCount(), c.getTotalPar()); menuOptions.add(new MenuOption(name, () -> { + if(Session.isGuest()) { + System.out.println("\nYou cannot add Courses as a Guest. Please login for this functionality."); + new MainMenu().present(); + } UndoManager.instance().capture(golfer, "Add course " + c.getName()); // add the course, try to save to DB. |
