Enum Class GameStatus

java.lang.Object
java.lang.Enum<GameStatus>
it.polimi.ingsw.am13.model.GameStatus
All Implemented Interfaces:
Serializable, Comparable<GameStatus>, Constable

public enum GameStatus extends Enum<GameStatus> implements Serializable
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 card
  • IN_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 turns
  • CALC_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
>
  • Enum Constant Details

    • INIT

      public static final GameStatus INIT
    • IN_GAME

      public static final GameStatus IN_GAME
    • FINAL_PHASE

      public static final GameStatus FINAL_PHASE
    • CALC_POINTS

      public static final GameStatus CALC_POINTS
    • ENDED

      public static final GameStatus ENDED
  • Constructor Details

    • GameStatus

      private GameStatus()
  • Method Details

    • values

      public static GameStatus[] 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

      public static GameStatus valueOf(String name)
      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 name
      NullPointerException - if the argument is null