本文整理汇总了C++中Campaign::getMapCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Campaign::getMapCount方法的具体用法?C++ Campaign::getMapCount怎么用?C++ Campaign::getMapCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::getMapCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: entry
CampaignMapEntryEditor::CampaignMapEntryEditor(Campaign& campaign, CampaignMapEntry& mapEntry) : entry(mapEntry), campaign(campaign)
{
StringTable& table=*Toolkit::getStringTable();
title = new Text(0, 18, ALIGN_FILL, ALIGN_SCREEN_CENTERED, "menu", table.getString("[editing map]"));
mapsUnlockedBy = new CheckList(10, 80, 150, 300, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", false);
mapsUnlockedByLabel = new Text(10, 50, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", table.getString("[unlocked by]"));
nameEditorLabel = new Text(405, 80, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", table.getString("[map name]"));
nameEditor=new TextInput(420, 105, 180, 25, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", entry.getMapName());
isUnlockedLabel = new Text(430, 140, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", table.getString("[unlocked at start]"));
isUnlocked = new OnOffButton(405, 140, 20, 20, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, entry.isUnlocked(), ISLOCKED);
descriptionEditorLabel = new Text(405, 170, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", table.getString("[map description]"));
descriptionEditor = new TextArea(420, 195, 180, 225, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", false, entry.getDescription().c_str());
ok = new TextButton(260, 430, 180, 40, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "menu", table.getString("[ok]"), OK);
cancel = new TextButton(450, 430, 180, 40, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "menu", table.getString("[Cancel]"), CANCEL);
std::set<std::string> unlockedBy;
for(unsigned n=0; n<entry.getUnlockedByMaps().size(); ++n)
{
unlockedBy.insert(entry.getUnlockedByMaps()[n]);
}
for(unsigned n=0; n<campaign.getMapCount(); ++n)
{
if(campaign.getMap(n).getMapName() != entry.getMapName())
{
if(unlockedBy.find(campaign.getMap(n).getMapName())==unlockedBy.end())
{
mapsUnlockedBy->addItem(campaign.getMap(n).getMapName(), false);
}
else
{
mapsUnlockedBy->addItem(campaign.getMap(n).getMapName(), true);
}
}
}
addWidget(title);
addWidget(mapsUnlockedBy);
addWidget(mapsUnlockedByLabel);
addWidget(nameEditorLabel);
addWidget(nameEditor);
addWidget(isUnlockedLabel);
addWidget(isUnlocked);
addWidget(descriptionEditorLabel);
addWidget(descriptionEditor);
addWidget(ok);
addWidget(cancel);
}