Enum Class TowerColour

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

public enum TowerColour extends Enum<TowerColour> implements Serializable
Towers are bound to a colour, and each colour is bound to a team. This enum represents the colour-team link
  • Enum Constant Details

  • Field Details

  • Constructor Details

    • TowerColour

      private TowerColour(TeamID teamId)
      Internal constructor of the enum
      Parameters:
      teamId - the team to bind the tower to
  • Method Details

    • values

      public static TowerColour[] 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 TowerColour 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
    • fromTeamId

      public static TowerColour fromTeamId(TeamID tID)
      Get the TowerColour connected to a TeamID
      Parameters:
      tID - the TeamID enum representing a team
      Returns:
      the TowerColour bound to a particular TeamID
    • getTeamID

      public TeamID getTeamID()
      Get the TeamID bound to a specific color of the tower
      Returns:
      the TeamID bound to the current TowerColour variant