Class GameStartEvent

java.lang.Object
com.ohacd.matchbox.api.MatchboxEvent
com.ohacd.matchbox.api.events.GameStartEvent

public class GameStartEvent extends MatchboxEvent
Event fired when a new game starts.
Since:
0.9.5
  • Constructor Details

    • GameStartEvent

      public GameStartEvent(@NotNull @NotNull String sessionName, @NotNull @NotNull Collection<org.bukkit.entity.Player> players, @NotNull @NotNull Map<org.bukkit.entity.Player,com.ohacd.matchbox.game.utils.Role> roleAssignments)
      Creates a new game start event.
      Parameters:
      sessionName - the session name
      players - all players in the game
      roleAssignments - mapping of players to their roles
  • Method Details

    • dispatch

      public void dispatch(@NotNull @NotNull MatchboxEventListener listener)
      Description copied from class: MatchboxEvent
      Dispatches this event to the appropriate listener method.

      This method uses the visitor pattern to call the correct handler method based on the concrete event type. Implementing classes should call super.dispatch(listener) as the first line.

      Specified by:
      dispatch in class MatchboxEvent
      Parameters:
      listener - the listener to dispatch to
    • getSessionName

      @NotNull public @NotNull String getSessionName()
      Gets the name of the session where the game started.
      Returns:
      the session name
    • getPlayers

      @NotNull public @NotNull Collection<org.bukkit.entity.Player> getPlayers()
      Gets all players participating in the game.
      Returns:
      collection of all players
    • getRoleAssignments

      @NotNull public @NotNull Map<org.bukkit.entity.Player,com.ohacd.matchbox.game.utils.Role> getRoleAssignments()
      Gets the role assignments for all players.
      Returns:
      mapping of players to their assigned roles