net.sf.colossus.game
Enum PlayerColor

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

public enum PlayerColor
extends java.lang.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 Summary
BLACK
           
BLUE
           
BROWN
           
GOLD
           
GREEN
           
INDIGO
           
ORANGE
           
PINE
           
PURPLE
           
RED
           
SILVER
           
SKY
           
 
Field Summary
private  java.awt.Color backgroundColor
           
private  java.awt.Color foregroundColor
           
private  int mnemonic
           
private  java.lang.String name
           
private  java.lang.String shortName
           
 
Method Summary
 java.awt.Color getBackgroundColor()
           
static java.util.List<PlayerColor> getByName(java.util.List<java.lang.String> names)
           
static PlayerColor getByName(java.lang.String name)
           
static PlayerColor getByShortName(java.lang.String shortName)
           
 java.awt.Color getForegroundColor()
           
 int getMnemonic()
           
 java.lang.String getName()
           
 java.lang.String getShortName()
           
 java.lang.String toString()
           
static PlayerColor valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static PlayerColor[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BLACK

public static final PlayerColor BLACK

BLUE

public static final PlayerColor BLUE

BROWN

public static final PlayerColor BROWN

GOLD

public static final PlayerColor GOLD

GREEN

public static final PlayerColor GREEN

RED

public static final PlayerColor RED

ORANGE

public static final PlayerColor ORANGE

PURPLE

public static final PlayerColor PURPLE

SILVER

public static final PlayerColor SILVER

SKY

public static final PlayerColor SKY

PINE

public static final PlayerColor PINE

INDIGO

public static final PlayerColor INDIGO
Field Detail

name

private final java.lang.String name

shortName

private final java.lang.String shortName

mnemonic

private final int mnemonic

backgroundColor

private final java.awt.Color backgroundColor

foregroundColor

private final java.awt.Color foregroundColor
Method Detail

values

public static PlayerColor[] 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 (PlayerColor c : PlayerColor.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PlayerColor 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

getMnemonic

public int getMnemonic()

getName

public java.lang.String getName()

getShortName

public java.lang.String getShortName()

getBackgroundColor

public java.awt.Color getBackgroundColor()

getForegroundColor

public java.awt.Color getForegroundColor()

getByName

public static PlayerColor getByName(java.lang.String name)

getByShortName

public static PlayerColor getByShortName(java.lang.String shortName)

getByName

public static java.util.List<PlayerColor> getByName(java.util.List<java.lang.String> names)

toString

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