本文整理汇总了C++中team::uses_shroud方法的典型用法代码示例。如果您正苦于以下问题:C++ team::uses_shroud方法的具体用法?C++ team::uses_shroud怎么用?C++ team::uses_shroud使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类team
的用法示例。
在下文中一共展示了team::uses_shroud方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generate_report
//.........这里部分代码省略.........
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);
if (current_side != playing_side)
str << font::GRAY_TEXT;
str << data.expenses;
break;
}
case INCOME: {
team_data data = calculate_team_data(viewing_team, current_side);
if (current_side != playing_side)
str << font::GRAY_TEXT;
else if (data.net_income < 0)
str << font::BAD_TEXT;
示例2: generate_report
//.........这里部分代码省略.........
tooltip << tod.name << "\n"
<< _("Lawful units: ")
<< (tod.lawful_bonus > 0 ? "+" : "") << tod.lawful_bonus << "%\n"
<< _("Neutral units: ") << "0%\n"
<< _("Chaotic units: ")
<< (tod.lawful_bonus < 0 ? "+" : "") << (tod.lawful_bonus*-1) << "%";
return report("",tod_image,tooltip.str());
}
case TURN: {
str << 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: {
char const *end = naps;
if (current_side != playing_side)
str << span_color(font::GRAY_COLOUR);
else if (current_team.gold() < 0)
str << span_color(font::BAD_COLOUR);
else
end = "";
str << current_team.gold() << end;
break;
}
case VILLAGES: {
const team_data data = calculate_team_data(current_team,current_side,units);
if (current_side != playing_side)
str << span_color(font::GRAY_COLOUR);
str << data.villages << '/';
if (current_team.uses_shroud()) {
int unshrouded_villages = 0;
std::vector<map_location>::const_iterator i = map.villages().begin();
for (; i != map.villages().end(); i++) {
if (!current_team.shrouded(*i))
unshrouded_villages++;
}
str << unshrouded_villages;
} else {
str << map.villages().size();
}
if (current_side != playing_side)
str << naps;
break;
}
case NUM_UNITS: {
if (current_side != playing_side)
str << span_color(font::GRAY_COLOUR);
str << side_units(units, current_side);
if (current_side != playing_side)
str << naps;
break;
}
case UPKEEP: {
const team_data data = calculate_team_data(current_team,current_side,units);
if (current_side != playing_side)
str << span_color(font::GRAY_COLOUR);
str << data.expenses << " (" << data.upkeep << ")";
if (current_side != playing_side)
str << naps;
break;
}
case EXPENSES: {