If you think the Android project GhostStories listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package games.ghoststories.enums;
//fromwww.java2s.comimport games.ghoststories.R;
import java.util.EnumSet;
import android.graphics.Color;
/**
* Defines the different colors used throughout the game
*/publicenum EColor {
BLACK(R.id.black_tao_tokens, Color.BLACK, Color.BLACK, Color.BLACK),
BLUE(R.id.blue_tao_tokens, Color.BLUE, Color.rgb(0,153,255), Color.rgb(0,47,140)),
GREEN(R.id.green_tao_tokens, Color.GREEN, Color.rgb(51, 204,0), Color.rgb(0,132,0)),
RED(R.id.red_tao_tokens, Color.RED, Color.rgb(222,0,0), Color.rgb(132,0,0)),
YELLOW(R.id.yellow_tao_tokens, Color.YELLOW, Color.rgb(247,247,49), Color.rgb(132,132,0));
/**
* Constructor
* @param pTokenId The id of the token with this color
* @param pColor The actual color
* @param pLightColor A light version of the color
* @param pDarkColor A dark version of the color
*/private EColor(int pTokenId, int pColor, int pLightColor, int pDarkColor) {
mTokenId = pTokenId;
mColor = pColor;
mLightColor = pLightColor;
mDarkColor = pDarkColor;
}
/**
* @return The actual color
*/publicint getColor() {
return mColor;
}
/**
* @return A dark version of the color
*/publicint getDarkColor() {
return mDarkColor;
}
/**
* @return A light version of the color
*/publicint getLightColor() {
return mLightColor;
}
/**
* @return The id of the token with this color
*/publicint getTokenId() {
return mTokenId;
}
/**
* @return The colors that are valid for players
*/publicstatic EnumSet<EColor> getPlayerColors() {
return sPlayerColors;
}
/** The colors that are valid for players **/privatestaticfinal EnumSet<EColor> sPlayerColors =
EnumSet.of(EColor.YELLOW, EColor.BLUE, EColor.RED, EColor.GREEN);
/** The actual color **/privatefinalint mColor;
/** Dark version of the color **/privatefinalint mDarkColor;
/** Light version of the color **/privatefinalint mLightColor;
/** The id of the token with this color **/privatefinalint mTokenId;
}