summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/settings.json3
-rw-r--r--data/personaldb.json32
-rw-r--r--src/main/java/design/controller/userinput/menus/CourseSearch.java4
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.