MCPcopy Index your code
hub / github.com/aws-samples/eb-java-scorekeep / saveState

Method saveState

src/main/java/scorekeep/StateModel.java:25–36  ·  view source on GitHub ↗
(State state)

Source from the content-addressed store, hash-verified

23 private final GameModel gameModel = new GameModel();
24
25 public void saveState(State state) throws SessionNotFoundException, GameNotFoundException {
26 // check session
27 String sessionId = state.getSession();
28 String gameId = state.getGame();
29 if (sessionModel.loadSession(sessionId) == null ) {
30 throw new SessionNotFoundException(sessionId);
31 }
32 if (gameModel.loadGame(gameId) == null ) {
33 throw new GameNotFoundException(gameId);
34 }
35 mapper.save(state);
36 }
37
38 public State loadState(String stateId) throws StateNotFoundException {
39 State state = mapper.load(State.class, stateId);

Callers 2

newMoveMethod · 0.80
newStateMethod · 0.80

Calls 4

loadSessionMethod · 0.80
loadGameMethod · 0.80
getSessionMethod · 0.45
getGameMethod · 0.45

Tested by

no test coverage detected