blob: 5b00e6728d6d68804b3b8885ddeeb4742028f1d8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package design.runtime;
import design.model.Golfer;
import java.time.LocalDateTime;
public final class Session {
private static Golfer currentGolfer;
private static LocalDateTime timeOverride;
private static boolean isGuest = false;
public static Golfer getCurrentGolfer() {
return currentGolfer;
}
public static void setCurrentGolfer(Golfer currentGolfer) {
Session.setGuest(false);
Session.currentGolfer = currentGolfer;
}
public static LocalDateTime getDateTime() {
return timeOverride != null ? timeOverride : LocalDateTime.now();
}
public static void setTimeOverride(LocalDateTime timeOverride) {
Session.timeOverride = timeOverride;
}
public static boolean isGuest() {
return isGuest;
}
public static void setGuest(boolean g) {
isGuest = g;
}
}
|