Added: EventType toString

This commit is contained in:
rubenpirreram
2026-05-26 19:30:57 +02:00
parent 1aff264cc5
commit bfbf7890d3
2 changed files with 23 additions and 14 deletions
@@ -9,60 +9,69 @@ public enum EventType {
/**
* Event used to add a player to the game.
*/
ADD_PLAYER,
ADD_PLAYER("Add Player Event"),
/**
* Event used to submit a player's totem choice.
*/
TOTEM_CHOICE,
TOTEM_CHOICE("Totem Choice"),
/**
* Event used to submit a player's slot choice.
*/
SLOT_CHOICE,
SLOT_CHOICE("Slot Choice"),
/**
* Event used to draw a tribe card from the upper card list.
*/
DRAW_UPPER_TRIBE,
DRAW_UPPER_TRIBE("Drawing Upper Tribe"),
/**
* Event used to draw a tribe card from the lower card list.
*/
DRAW_LOWER_TRIBE,
DRAW_LOWER_TRIBE("Drawing Lower Tribe"),
/**
* Event used to draw a building card from the upper card list.
*/
DRAW_UPPER_BUILD,
DRAW_UPPER_BUILD("Drawing Upper Build"),
/**
* Event used to draw a building card from the lower card list.
*/
DRAW_LOWER_BUILD,
DRAW_LOWER_BUILD("Drawing Lower Build"),
/**
* Event used to skip the current turn or optional action.
*/
SKIP_TURN,
SKIP_TURN("Skip Turn"),
/**
* Event used to notify that a player has disconnected.
*/
DISCONNECTED_PLAYER,
DISCONNECTED_PLAYER("Disconnected Player"),
/**
* Event used to notify that a player has reconnected.
*/
RECONNECT_PLAYER,
RECONNECT_PLAYER("Reconnect Player"),
/**
* Event used to apply the transition to the next round.
*/
NEXT_ROUND,
NEXT_ROUND("Next Round"),
/**
* Event used to notify that the game has ended.
*/
ENDED_GAME
ENDED_GAME("Ended Game");
private String description;
private EventType(String description) {
this.description = description;
}
@Override
public String toString() {
return description;
}
}
@@ -141,9 +141,9 @@ public abstract class NetworkEvent implements Serializable {
@Override
public String toString() {
if (isError) {
return "ERROR: action " + eventType;
return "ERROR: " + eventType;
} else {
return "ACTION: action " + eventType;
return "ACTION: " + eventType;
}
}