Enum Class TeamID

java.lang.Object
java.lang.Enum<TeamID>
it.polimi.ingsw.Model.Enums.TeamID
All Implemented Interfaces:
Serializable, Comparable<TeamID>, Constable

public enum TeamID extends Enum<TeamID> implements Serializable
There are only a handful of possible teams in a game. This enumeration represents them
  • Enum Constant Details

    • ONE

      public static final TeamID ONE
    • TWO

      public static final TeamID TWO
    • THREE

      public static final TeamID THREE
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • teamID

      private final int teamID
  • Constructor Details

    • TeamID

      private TeamID(int teamID)
      Internal constructor of the enum
      Parameters:
      teamID - the id of the team
  • Method Details

    • values

      public static TeamID[] 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 TeamID 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
    • fromInteger

      public static TeamID fromInteger(int id)
      Given an integer, find the corresponding team
      Parameters:
      id - the id of the team to enumerate
      Returns:
      the TeamID enum variant if the id is between 0 and 3 (excluded), otherwise returns null