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

Method deleteGame

src/main/java/scorekeep/GameModel.java:59–75  ·  view source on GitHub ↗
(String sessionId, String gameId)

Source from the content-addressed store, hash-verified

57 }
58
59 public void deleteGame(String sessionId, String gameId) throws GameNotFoundException {
60 Game game = mapper.load(Game.class, gameId);
61 if ( game == null ) {
62 throw new GameNotFoundException(gameId);
63 }
64 mapper.delete(game);
65 //delete game from session
66 Session session = mapper.load(Session.class, sessionId);
67 Set<String> sessionGames = session.getGames();
68 sessionGames.remove(gameId);
69 if (sessionGames.size() == 0) {
70 session.clearGames();
71 } else {
72 session.setGames(sessionGames);
73 }
74 mapper.save(session);
75 }
76}

Callers 1

SessionFunction · 0.45

Calls 3

getGamesMethod · 0.95
clearGamesMethod · 0.95
setGamesMethod · 0.95

Tested by

no test coverage detected