summaryrefslogtreecommitdiff
path: root/src/main/java/design/model/holeplay/HoleCompleteState.java
blob: 958fe5f4c559942e61d1c847e6549d0d27d7e2c7 (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
package design.model.holeplay;

public class HoleCompleteState implements HoleState {
    @Override
    public void enter(HolePlayContext ctx) {
        /* compute summaries if needed */ }

    @Override
    public void handleStart(HolePlayContext ctx) {
        // optional: treat this as “Next Hole”
        ctx.setState(new SetupState());
    }

    @Override
    public void handleShot(HolePlayContext ctx, design.model.Club club, Integer distanceYds) {
        throw new IllegalStateException("Hole is complete; start next hole.");
    }

    @Override
    public void handleHoleOut(HolePlayContext ctx) {
        throw new IllegalStateException("Already holed out.");
    }

    @Override
    public String name() {
        return "HoleCompleteState";
    }
}