本文整理汇总了Java中org.pircbotx.Colors.BROWN属性的典型用法代码示例。如果您正苦于以下问题:Java Colors.BROWN属性的具体用法?Java Colors.BROWN怎么用?Java Colors.BROWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.pircbotx.Colors
的用法示例。
在下文中一共展示了Colors.BROWN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
/**
* String representation of the card with IRC color formatting.
* Gives the card a colour based on suit and adds a white background.
*
* @return a IRC colour formatted string with the card's face and suit
*/
@Override
public String toString(){
String color;
if (suit.equals(CardDeck.suits[0])){
color = Colors.RED;
} else if ( suit.equals(CardDeck.suits[1])){
color = Colors.BROWN;
} else if ( suit.equals(CardDeck.suits[2])){
color = Colors.DARK_BLUE;
} else {
color = Colors.BLACK;
}
return color + ",00" + face + suit;
}
示例2: handleParty
/**
* Handles the partying coin command.
*
* @param currencies The list of currencies from CoinMarketCap.
* @param nf The NumberFormat instance for formatting currencies.
* @param cmd The command issued, either "party" or "dump".
* @return the bot's response.
*/
private BotResponse handleParty(final List<CoinMarketCapResponse> currencies, final NumberFormat nf,
final String cmd) {
double result = 0;
CoinMarketCapResponse partyCoin = null;
for (CoinMarketCapResponse x : currencies) {
try {
double change = Double.parseDouble(x.getPercentChange24h());
if (cmd.equals("party") && change > result) {
partyCoin = x;
} else if (cmd.equals("dump") && change < result) {
partyCoin = x;
}
} catch (NumberFormatException ex) {
log.warn("Failed to parse change data: " + x.getPercentChange24h());
}
}
String color;
if (cmd.equals("party")) {
color = Colors.MAGENTA;
} else {
color = Colors.BROWN;
}
if (partyCoin != null) {
return new BotResponse(BotIntention.CHAT, null, color + Colors.BOLD
+ partyCoin.getName() + Colors.NORMAL + Colors.TEAL + ": "
+ nf.format(Double.valueOf(partyCoin.getPriceUsd())) + " | Rank: "
+ partyCoin.getRank() + Colors.TEAL + " | Market Cap: "
+ nf.format(Double.valueOf(partyCoin.getMarketCapUsd())),
Colors.TEAL
+ "[Hour " + getColoredChangeText(partyCoin.getPercentChange1h()) + "] | "
+ "[Day " + getColoredChangeText(partyCoin.getPercentChange24h()) + "]");
} else {
log.error("Failed to find a partying coin!");
return new BotResponse(BotIntention.NO_REPLY, null, null);
}
}
示例3: determineColor
private String determineColor(ItemClass color2) {
switch(color2) {
case Normal: case Newbie: return Colors.NORMAL;
case Animal: return Colors.BOLD + Colors.BROWN;
case Spiritual: return Colors.BOLD + Colors.BLUE;
case Saint: return Colors.BOLD + Colors.DARK_BLUE;
case Avatar: return Colors.BOLD + Colors.DARK_GREEN;
case Special: return Colors.BOLD + Colors.PURPLE;
case Retro: return Colors.BOLD + Colors.BLACK;
case Idle: return Colors.BOLD + Colors.MAGENTA;
}
return Colors.MAGENTA;
}