Package breitband.GUI

Enum GameState

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<GameState>

    public enum GameState
    extends java.lang.Enum<GameState>
    States for managing in which phase of a turn the player is
    Author:
    Juno Veenstra
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BUILDING_PHASE
      Game state when a player is building connections between cities (3rd phase)
      COLLECTION_PHASE
      Game state when a player is buying new cables (2nd phase)
      CONTRACT_PHASE
      Game state when a player is choosing a contract (1st phase)
      DEFAULT
      Game state whenever a Human is not providing inputs
      SENDING_MOVE
      Game state when a player has finished their turn and the move is being constructed
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static GameState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static GameState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DEFAULT

        public static final GameState DEFAULT
        Game state whenever a Human is not providing inputs
      • CONTRACT_PHASE

        public static final GameState CONTRACT_PHASE
        Game state when a player is choosing a contract (1st phase)
      • COLLECTION_PHASE

        public static final GameState COLLECTION_PHASE
        Game state when a player is buying new cables (2nd phase)
      • BUILDING_PHASE

        public static final GameState BUILDING_PHASE
        Game state when a player is building connections between cities (3rd phase)
      • SENDING_MOVE

        public static final GameState SENDING_MOVE
        Game state when a player has finished their turn and the move is being constructed

        This state is used to signal that a player has given all necessary inputs

    • Method Detail

      • values

        public static GameState[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (GameState c : GameState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static GameState valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null