Package net.blueva.arcade.api.events
Class PlayerLeaveGameEvent<P>
java.lang.Object
net.blueva.arcade.api.events.GameEvent
net.blueva.arcade.api.events.PlayerLeaveGameEvent<P>
- Type Parameters:
P- the player type (platform-specific)
Event fired when a player leaves a game.
This event is triggered whenever a player exits a game, whether voluntarily or involuntarily. The leave reason provides context about why the player left the game. Game modules can listen to this event to handle player departures and update game state accordingly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the different reasons why a player can leave a game. -
Constructor Summary
ConstructorsConstructorDescriptionPlayerLeaveGameEvent(int arenaId, String gameId, P player, PlayerLeaveGameEvent.LeaveReason reason) Constructs a new PlayerLeaveGameEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets the player who is leaving the game.Gets the reason why the player is leaving.Methods inherited from class net.blueva.arcade.api.events.GameEvent
getArenaId, getGameId
-
Constructor Details
-
PlayerLeaveGameEvent
public PlayerLeaveGameEvent(int arenaId, String gameId, P player, PlayerLeaveGameEvent.LeaveReason reason) Constructs a new PlayerLeaveGameEvent.- Parameters:
arenaId- the ID of the arena the player is leavinggameId- the unique identifier of the game moduleplayer- the player who is leaving the gamereason- the reason why the player is leaving
-
-
Method Details
-
getPlayer
Gets the player who is leaving the game.- Returns:
- the player leaving the game
-
getReason
Gets the reason why the player is leaving.- Returns:
- the leave reason
-