Class GameManager

java.lang.Object
de.presti.ree6.game.core.GameManager

public class GameManager extends Object
Class to manage Games.
  • 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

      public static String generateInvite()
      Generate a valid Invite
      Returns:
      the newly create Invite.
    • getGame

      public static IGame getGame(String gameName, GameSession gameSession)
      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

      public static GameSession getGameSession(String gameIdentifier)
      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

      public static List<GameSession> getGameSessions()
      Method used to get all GameSessions.
      Returns:
      A List of GameSessions.
    • removeGameSession

      public static void removeGameSession(GameSession session)
      Method used to remove a GameSession.
      Parameters:
      session - The GameSession.
    • getGames

      public static Collection<Class<? extends IGame>> getGames()
      Method that returns every cache Game.
      Returns:
      A List of Games.