- All Implemented Interfaces:
Serializable
,Comparable<GameStatus>
,Constable
Represents phases of the flow of the game
- Creation of the game itself doesn't have a game phase. In this pre-game status, decks are created and already shuffled. The common cards are so set and can be considered already in field. It is also selected randomly the first player
INIT
: Initialization, during which players are given their first cards. Each player must play their starter card and choose their personal objective cardIN_GAME
: The turn-based phase. Each player, starting from the first player chosen, play their turn by placing a card on the field and subsequently picking a card from the six "pickable" cards in the common field. This phase ends when one of the player reaches 20 points after playing a card, or when both of the decks are empty after picking a card.FINAL_PHASE
: The last turn-based phase. It's the same as IN_GAME, but it lasts for a determined number of turns, calculated when phase IN_GAME becomes FINAL_PHASE, in order to finish round (reaching the turn of the first player) and play another extra round. In the end, all players must play the same number of turnsCALC_POINTS
: Now the turn-bases phases are completed, and players don't have to do anything. In this phase, the extra points given by the objective card (2 common, 1 personal) are added to the players' score.ENDED
: After adding the extra points, the winner can be calculated as the player with the maximum accumulated points
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GameStatus
Returns the enum constant of this class with the specified name.static GameStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INIT
-
IN_GAME
-
FINAL_PHASE
-
CALC_POINTS
-
ENDED
-
-
Constructor Details
-
GameStatus
private GameStatus()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-