当前位置: 首页>>代码示例>>Java>>正文


Java Colors.BROWN属性代码示例

本文整理汇总了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;
}
 
开发者ID:brrr2,项目名称:irccasino,代码行数:21,代码来源:Card.java

示例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);
    }
}
 
开发者ID:proxa,项目名称:IRCbutt,代码行数:44,代码来源:CryptocurrencyCommand.java

示例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;
}
 
开发者ID:kellyirc,项目名称:idlemaster,代码行数:13,代码来源:Item.java


注:本文中的org.pircbotx.Colors.BROWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。