Package it.polimi.ingsw.Model.Enums
Enum Class TowerColour
- All Implemented Interfaces:
Serializable
,Comparable<TowerColour>
,Constable
Towers are bound to a colour, and each colour is bound to a team. This enum represents the colour-team link
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
TowerColour
(TeamID teamId) Internal constructor of the enum -
Method Summary
Modifier and TypeMethodDescriptionstatic TowerColour
fromTeamId
(TeamID tID) Get theTowerColour
connected to aTeamID
Get theTeamID
bound to a specific color of the towerstatic TowerColour
Returns the enum constant of this class with the specified name.static TowerColour[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BLACK
-
WHITE
-
GRAY
-
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
teamID
-
-
Constructor Details
-
TowerColour
Internal constructor of the enum- Parameters:
teamId
- the team to bind the tower to
-
-
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
-
fromTeamId
Get theTowerColour
connected to aTeamID
- Parameters:
tID
- theTeamID
enum representing a team- Returns:
- the
TowerColour
bound to a particularTeamID
-
getTeamID
Get theTeamID
bound to a specific color of the tower- Returns:
- the
TeamID
bound to the currentTowerColour
variant
-