Class GamesRepository

java.lang.Object
it.polimi.ingsw.server.repository.GamesRepository

public class GamesRepository extends Object
  • Field Details

    • c

      private final Connection c
    • instance

      private static GamesRepository instance
    • dotenv

      private static final io.github.cdimascio.dotenv.Dotenv dotenv
  • Constructor Details

  • Method Details

    • getInstance

      public static GamesRepository getInstance()
    • saveUserSchoolBoardMap

      public void saveUserSchoolBoardMap(UUID gameUUID, String username, int schoolBoardID)
      Save the map from username to the gameUUID and the schoolBoardID
      Parameters:
      gameUUID - of the game
      username - of the user
      schoolBoardID - of the user
    • removeFromCurrentGames

      public void removeFromCurrentGames(UUID gameUUID)
    • getCurrentGames

      public Map<org.javatuples.Pair<String,Boolean>,List<org.javatuples.Pair<String,Integer>>> getCurrentGames()
      Return map (GameUUID, expertMode) -> List(username, schoolBoardID)
      Returns:
      a map that contains games, usernames and schoolBoardIDs