本文整理汇总了C++中team::carryover_add方法的典型用法代码示例。如果您正苦于以下问题:C++ team::carryover_add方法的具体用法?C++ team::carryover_add怎么用?C++ team::carryover_add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类team
的用法示例。
在下文中一共展示了team::carryover_add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: report_victory
void campaign_controller::report_victory(
std::ostringstream &report, team& t,
int finishing_bonus_per_turn, int turns_left, int finishing_bonus)
{
report << "<small>" << _("Remaining gold: ") << utils::half_signed_value(t.gold()) << "</small>";
if(t.carryover_bonus() != 0) {
if (turns_left > -1) {
report << "\n\n<b>" << _("Turns finished early: ") << turns_left << "</b>\n"
<< "<small>" << _("Early finish bonus: ") << finishing_bonus_per_turn << _(" per turn") << "</small>\n"
<< "<small>" << _("Total bonus: ") << finishing_bonus << "</small>\n";
}
report << "<small>" << _("Total gold: ") << utils::half_signed_value(t.gold() + finishing_bonus) << "</small>";
}
if (t.gold() > 0) {
report << "\n<small>" << _("Carryover percentage: ") << t.carryover_percentage() << "</small>";
}
if(t.carryover_add()) {
report << "\n\n<big><b>" << _("Bonus gold: ") << utils::half_signed_value(t.carryover_gold()) << "</b></big>";
} else {
report << "\n\n<big><b>" << _("Retained gold: ") << utils::half_signed_value(t.carryover_gold()) << "</b></big>";
}
std::string goldmsg;
utils::string_map symbols;
symbols["gold"] = lexical_cast_default<std::string>(t.carryover_gold());
// Note that both strings are the same in English, but some languages will
// want to translate them differently.
if(t.carryover_add()) {
if(t.carryover_gold() > 0) {
goldmsg = vngettext(
"You will start the next scenario with $gold "
"on top of the defined minimum starting gold.",
"You will start the next scenario with $gold "
"on top of the defined minimum starting gold.",
t.carryover_gold(), symbols);
} else {
goldmsg = vngettext(
"You will start the next scenario with "
"the defined minimum starting gold.",
"You will start the next scenario with "
"the defined minimum starting gold.",
t.carryover_gold(), symbols);
}
} else {
goldmsg = vngettext(
"You will start the next scenario with $gold "
"or its defined minimum starting gold, "
"whichever is higher.",
"You will start the next scenario with $gold "
"or its defined minimum starting gold, "
"whichever is higher.",
t.carryover_gold(), symbols);
}
// xgettext:no-c-format
report << "\n" << goldmsg;
}