Added: EventType toString
This commit is contained in:
@@ -9,60 +9,69 @@ public enum EventType {
|
|||||||
/**
|
/**
|
||||||
* Event used to add a player to the game.
|
* 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.
|
* Event used to submit a player's totem choice.
|
||||||
*/
|
*/
|
||||||
TOTEM_CHOICE,
|
TOTEM_CHOICE("Totem Choice"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event used to submit a player's slot 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.
|
* 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.
|
* 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.
|
* 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.
|
* 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.
|
* 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.
|
* Event used to notify that a player has disconnected.
|
||||||
*/
|
*/
|
||||||
DISCONNECTED_PLAYER,
|
DISCONNECTED_PLAYER("Disconnected Player"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event used to notify that a player has reconnected.
|
* 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.
|
* 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.
|
* 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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
if (isError) {
|
if (isError) {
|
||||||
return "ERROR: action " + eventType;
|
return "ERROR: " + eventType;
|
||||||
} else {
|
} else {
|
||||||
return "ACTION: action " + eventType;
|
return "ACTION: " + eventType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user