Class GamesRepository
java.lang.Object
it.polimi.ingsw.server.repository.GamesRepository
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Connectionprivate static final io.github.cdimascio.dotenv.Dotenvprivate static GamesRepository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn map (GameUUID, expertMode) -> List(username, schoolBoardID)static GamesRepositoryvoidremoveFromCurrentGames(UUID gameUUID) voidsaveUserSchoolBoardMap(UUID gameUUID, String username, int schoolBoardID) Save the map from username to the gameUUID and the schoolBoardID
-
Field Details
-
c
-
instance
-
dotenv
private static final io.github.cdimascio.dotenv.Dotenv dotenv
-
-
Constructor Details
-
GamesRepository
Singleton, private constructor- Throws:
DBNotFoundException- if there is a problem with the connection to the DB
-
-
Method Details
-
getInstance
-
saveUserSchoolBoardMap
Save the map from username to the gameUUID and the schoolBoardID- Parameters:
gameUUID- of the gameusername- of the userschoolBoardID- of the user
-
removeFromCurrentGames
-
getCurrentGames
public Map<org.javatuples.Pair<String,Boolean>, getCurrentGames()List<org.javatuples.Pair<String, Integer>>> Return map (GameUUID, expertMode) -> List(username, schoolBoardID)- Returns:
- a map that contains games, usernames and schoolBoardIDs
-