Package de.presti.ree6.game.core
Class GameManager
java.lang.Object
de.presti.ree6.game.core.GameManager
Class to manage Games.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GameSession
createGameSession
(String gameIdentifier, String gameName, net.dv8tion.jda.api.entities.Member host, net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion channel, ArrayList<net.dv8tion.jda.api.entities.User> participants) Method used to create a new GameSession.static String
Generate a valid Invitestatic IGame
getGame
(String gameName, GameSession gameSession) Method used to get a Game by its name.static Collection<Class<? extends IGame>>
getGames()
Method that returns every cache Game.static GameSession
getGameSession
(String gameIdentifier) Method used to get a GameSession by its Identifier.static List<GameSession>
Method used to get all GameSessions.static List<GameSession>
getGameSessions
(net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion channel) Method used to get all GameSessions.static void
Should be called to load all Games into the cache.static void
removeGameSession
(GameSession session) Method used to remove a GameSession.
-
Constructor Details
-
GameManager
public GameManager()
-
-
Method Details
-
loadAllGames
public static void loadAllGames()Should be called to load all Games into the cache. -
createGameSession
public static GameSession createGameSession(String gameIdentifier, String gameName, net.dv8tion.jda.api.entities.Member host, net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion channel, ArrayList<net.dv8tion.jda.api.entities.User> participants) Method used to create a new GameSession.- Parameters:
gameIdentifier
- The Identifier of the Session.gameName
- The Name of the Game.host
- The Creator of the Game.channel
- The Channel where the Game is played.participants
- The Participants of the Game.- Returns:
- The created GameSession.
-
generateInvite
Generate a valid Invite- Returns:
- the newly create Invite.
-
getGame
Method used to get a Game by its name.- Parameters:
gameName
- The Name of the Game.gameSession
- The GameSession of the Game.- Returns:
- The Game.
-
getGameSession
Method used to get a GameSession by its Identifier.- Parameters:
gameIdentifier
- The Identifier of the GameSession.- Returns:
- The GameSession.
-
getGameSessions
public static List<GameSession> getGameSessions(net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion channel) Method used to get all GameSessions.- Parameters:
channel
- The Channel where the GameSessions are played.- Returns:
- A List of GameSessions.
-
getGameSessions
Method used to get all GameSessions.- Returns:
- A List of GameSessions.
-
removeGameSession
Method used to remove a GameSession.- Parameters:
session
- The GameSession.
-
getGames
Method that returns every cache Game.- Returns:
- A List of Games.
-