本文整理汇总了C++中CvCity::isRevealed方法的典型用法代码示例。如果您正苦于以下问题:C++ CvCity::isRevealed方法的具体用法?C++ CvCity::isRevealed怎么用?C++ CvCity::isRevealed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvCity
的用法示例。
在下文中一共展示了CvCity::isRevealed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LeaderDiscussion
bool QuietDiplomacy::LeaderDiscussion(CvPlayer* human, CvPlayer* computer, const char* text)
{
CvAssertMsg(human && computer && text, "Quiet Diplomacy: Assertion error!");
CvAssertMsg(human->isHuman(), "Quiet Diplomacy: Not a human!");
// Send a notification.
CvNotifications* notifications = human->GetNotifications();
if(notifications)
{
// Create localized strings.
// Hardcode some translation strings so DLL can be used alone without XML texts.
std::string language = Localization::GetCurrentLanguage().GetType();
std::string message;
std::string summary;
if(DoesTextKeyExist("TXT_KEY_QUIETDIPLOMACY_LEADERDISCUSSION_SUMMARY") &&
DoesTextKeyExist("TXT_KEY_QUIETDIPLOMACY_LEADERDISCUSSION_MESSAGE"))
{
// Fetch from the database.
Localization::String localeSummary = Localization::Lookup("TXT_KEY_QUIETDIPLOMACY_LEADERDISCUSSION_SUMMARY");
localeSummary << Localization::Lookup(computer->getNameKey());
Localization::String localeMessage = Localization::Lookup("TXT_KEY_QUIETDIPLOMACY_LEADERDISCUSSION_MESSAGE");
localeMessage << Localization::Lookup(computer->getNameKey());
localeMessage << text;
summary = localeSummary.toUTF8();
message = localeMessage.toUTF8();
}
else
{
if(language == "pl_PL")
{
// Polish
Localization::String localeLeader = Localization::Lookup(computer->getNameKey());
size_t localeLeaderBytes = 0;
const char* localeLeaderString = localeLeader.toUTF8(localeLeaderBytes, 2);
summary += "Wiadomo\xc5\x9b\xc4\x87 od ";
summary.append(localeLeaderString, localeLeaderBytes);
message += Localization::Lookup(computer->getNameKey()).toUTF8();
message += ": ";
message += text;
}
else
{
// English
summary += "Message from ";
summary += Localization::Lookup(computer->getNameKey()).toUTF8();
message += Localization::Lookup(computer->getNameKey()).toUTF8();
message += ": ";
message += text;
}
}
// Get computer's capital.
int x = -1;
int y = -1;
CvCity* computerCapital = computer->getCapitalCity();
if(computerCapital && computerCapital->isRevealed(human->getTeam(), false))
{
x = computerCapital->getX();
y = computerCapital->getY();
}
// Add a notification.
notifications->Add(NOTIFICATION_PEACE_ACTIVE_PLAYER, message.c_str(), summary.c_str(), x, y, computer->GetID());
}
// Inform that we took care of it.
return true;
}