Class MusicQuiz

java.lang.Object
de.presti.ree6.game.impl.musicquiz.MusicQuiz
All Implemented Interfaces:
IGame

public class MusicQuiz extends Object implements IGame
Class representing the game "Music Quiz"
  • Constructor Details

    • MusicQuiz

      public MusicQuiz(GameSession gameSession)
      Constructor.
      Parameters:
      gameSession - The game session.
  • Method Details

    • createGame

      public void createGame()
      Description copied from interface: IGame
      Called when the Game is created.
      Specified by:
      createGame in interface IGame
    • startGame

      public void startGame()
      Description copied from interface: IGame
      Called when the Game is started.
      Specified by:
      startGame in interface IGame
    • joinGame

      public void joinGame(GamePlayer user)
      Description copied from interface: IGame
      Called when a User wants to join the Game.
      Specified by:
      joinGame in interface IGame
      Parameters:
      user - The User who wants to join.
    • leaveGame

      public void leaveGame(GamePlayer user)
      Description copied from interface: IGame
      Called when a User wants to leave the Game.
      Specified by:
      leaveGame in interface IGame
      Parameters:
      user - The User who wants to leave.
    • onMessageReceive

      public void onMessageReceive(net.dv8tion.jda.api.events.message.MessageReceivedEvent messageReceivedEvent)
      Description copied from interface: IGame
      Called when a Reaction is received.
      Specified by:
      onMessageReceive in interface IGame
      Parameters:
      messageReceivedEvent - The Event.
    • onButtonInteractionReceive

      public void onButtonInteractionReceive(net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent buttonInteractionEvent)
      Description copied from interface: IGame
      Called when a Button is clicked.
      Specified by:
      onButtonInteractionReceive in interface IGame
      Parameters:
      buttonInteractionEvent - The Event.
    • stopGame

      public void stopGame()
      Description copied from interface: IGame
      Called when the Game is stopped.
      Specified by:
      stopGame in interface IGame
    • selectNextSong

      public void selectNextSong()
      Select a new song and play the timer!
    • getParticipantByUserId

      public MusicQuizPlayer getParticipantByUserId(long userId)
      Retrieve a participant by his user id.
      Parameters:
      userId - The user id.
      Returns:
      The participant or null.