Package com.ohacd.matchbox.api.events
Class GameStartEvent
java.lang.Object
com.ohacd.matchbox.api.MatchboxEvent
com.ohacd.matchbox.api.events.GameStartEvent
Event fired when a new game starts.
- Since:
- 0.9.5
-
Constructor Summary
ConstructorsConstructorDescriptionGameStartEvent(@NotNull String sessionName, @NotNull Collection<org.bukkit.entity.Player> players, @NotNull Map<org.bukkit.entity.Player, com.ohacd.matchbox.game.utils.Role> roleAssignments) Creates a new game start event. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatch(@NotNull MatchboxEventListener listener) Dispatches this event to the appropriate listener method.@NotNull Collection<org.bukkit.entity.Player> Gets all players participating in the game.@NotNull Map<org.bukkit.entity.Player, com.ohacd.matchbox.game.utils.Role> Gets the role assignments for all players.@NotNull StringGets the name of the session where the game started.Methods inherited from class com.ohacd.matchbox.api.MatchboxEvent
getTimestamp, toString
-
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 nameplayers- all players in the gameroleAssignments- mapping of players to their roles
-
-
Method Details
-
dispatch
Description copied from class:MatchboxEventDispatches 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:
dispatchin classMatchboxEvent- Parameters:
listener- the listener to dispatch to
-
getSessionName
Gets the name of the session where the game started.- Returns:
- the session name
-
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
-