blob: 2715e7c91079028e7f18bc3c8586184eaa579758 (
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
|
package design.model.holeplay;
import design.model.Hole;
public class SetupState implements HoleState {
@Override
public void enter(HolePlayContext ctx) {
/* no-op */ }
@Override
public void handleStart(HolePlayContext ctx) {
// Pull current hole number & par from Round/Course
Hole start = ctx.getRound().getStartingHole(); // or compute from current-hole tracking if you add it
ctx.beginNewPlay(start.getNumber(), start.getPar());
ctx.setState(new PlayState());
}
@Override
public void handleShot(HolePlayContext ctx, design.model.Club club, Integer distanceYds) {
throw new IllegalStateException("Cannot record a shot during setup.");
}
@Override
public void handleHoleOut(HolePlayContext ctx) {
throw new IllegalStateException("Cannot hole out during setup.");
}
@Override
public String name() {
return "SetupState";
}
}
|