Enum Class PlayerColor

java.lang.Object
java.lang.Enum<PlayerColor>
net.sf.colossus.game.PlayerColor
All Implemented Interfaces:
Serializable, Comparable<PlayerColor>, Constable

public enum PlayerColor extends Enum<PlayerColor>
Models the notion of a color a player can pick. This is not just the actual color of the markers, but also the names used for it (long and short version) as well as a suitable foreground color. The marker color itself is available through the {getBackgroundColor() method.
  • Enum Constant Details

  • Field Details

    • name

      private final String name
    • shortName

      private final String shortName
    • mnemonic

      private final int mnemonic
    • backgroundColor

      private final Color backgroundColor
    • foregroundColor

      private final Color foregroundColor
  • Constructor Details

    • PlayerColor

      private PlayerColor(String name, String shortName, int mnemonic)
  • Method Details

    • values

      public static PlayerColor[] 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 PlayerColor 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
    • getMnemonic

      public int getMnemonic()
    • getName

      public String getName()
    • getShortName

      public String getShortName()
    • getBackgroundColor

      public Color getBackgroundColor()
    • getForegroundColor

      public Color getForegroundColor()
    • getByName

      public static PlayerColor getByName(String name)
    • getByShortName

      public static PlayerColor getByShortName(String shortName)
    • getByName

      public static List<PlayerColor> getByName(List<String> names)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<PlayerColor>