本文整理汇总了C++中team::cost_exponent方法的典型用法代码示例。如果您正苦于以下问题:C++ team::cost_exponent方法的具体用法?C++ team::cost_exponent怎么用?C++ team::cost_exponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类team
的用法示例。
在下文中一共展示了team::cost_exponent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generate_report
//.........这里部分代码省略.........
<< _("Chaotic units: ") << signed_percent(-b);
if (tod.liminal_present)
tooltip << "\n" << _("Liminal units: ") << signed_percent(c);
std::string tod_image = tod.image;
if (tod.lawful_bonus_modified > 0) tod_image += "~BRIGHTEN()";
else if (tod.lawful_bonus_modified < 0) tod_image += "~DARKEN()";
if (preferences::flip_time()) tod_image += "~FL(horiz)";
if (game_config::tiny_gui) {
return report("", tod_image, "");
} else {
return report("", tod_image, tooltip.str(), "time_of_day");
}
}
case TURN: {
str << teams[playing_side-1].name() << "[" << resources::tod_manager->turn() << "]";
int nb = resources::tod_manager->number_of_turns();
if (nb != -1) str << '/' << nb;
break;
}
// For the following status reports, show them in gray text
// when it is not the active player's turn.
case GOLD: {
//Supposes the full/"pathfind" unit map is applied
int fake_gold = viewing_team.gold();
if (current_side != playing_side) {
str << font::GRAY_TEXT;
} else if (fake_gold < 0) {
str << font::RED_TEXT;
}
int cost_exponent = viewing_team.cost_exponent();
int hundred = cost_exponent / 100;
str << viewing_team.gold() << "(" << hundred << "." << (cost_exponent - hundred * 100) / 10 << ")";
break;
}
case VILLAGES: {
const team_data data = calculate_team_data(viewing_team,current_side);
if (current_side != playing_side)
str << font::GRAY_TEXT;
str << data.villages << '/';
if (viewing_team.uses_shroud()) {
int unshrouded_villages = 0;
std::vector<map_location>::const_iterator i = map.villages().begin();
for (; i != map.villages().end(); ++i) {
if (!viewing_team.shrouded(*i))
++unshrouded_villages;
}
str << unshrouded_villages;
} else {
str << map.villages().size();
}
break;
}
case UPKEEP: {
const team_data data = calculate_team_data(viewing_team,current_side);
if (current_side != playing_side)
str << font::GRAY_TEXT;
str << data.expenses << "(" << data.upkeep << ")";
break;
}
case EXPENSES: {
const team_data data = calculate_team_data(viewing_team,current_side);