本文整理汇总了C++中ArticleDefinitionList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ArticleDefinitionList::push_back方法的具体用法?C++ ArticleDefinitionList::push_back怎么用?C++ ArticleDefinitionList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleDefinitionList
的用法示例。
在下文中一共展示了ArticleDefinitionList::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: list
/**
* Fill an ArticleList with the currently visible ArticleIds of the given section.
* @param save Pointer to saved game.
* @param rule Pointer to ruleset.
* @param section Article section to find, e.g. "XCOM Crafts & Armaments", "Alien Lifeforms", etc.
* @param data Article definition list object to fill data in.
*/
void Ufopaedia::list(SavedGame *save, Ruleset *rule, const std::string §ion, ArticleDefinitionList &data)
{
ArticleDefinitionList articles = getAvailableArticles(save, rule);
for (ArticleDefinitionList::iterator it=articles.begin(); it!=articles.end(); ++it)
{
if ((*it)->section == section)
{
data.push_back(*it);
}
}
}
示例2: getSectionList
/**
* Fill an ArticleList with the currently visible ArticleIds of the given section.
* @param section Article section to find, e.g. "XCOM Crafts & Armaments", "Alien Lifeforms", etc.
* @param data Article definition list object to fill data in.
*/
void UfopaediaSaved::getSectionList(const std::string §ion, ArticleDefinitionList &data)
{
ArticleDefinitionList::iterator it;
for (it=_visible_articles.begin(); it!=_visible_articles.end(); ++it)
{
if ((*it)->section == section)
{
data.push_back(*it);
}
}
}
示例3: getAvailableArticles
/**
* Return an ArticleList with all the currently visible ArticleIds.
* @param save Pointer to saved game.
* @param rule Pointer to ruleset.
* @return List of visible ArticleDefinitions.
*/
ArticleDefinitionList Ufopaedia::getAvailableArticles(SavedGame *save, Ruleset *rule)
{
const std::vector<std::string> &list = rule->getUfopaediaList();
ArticleDefinitionList articles;
for (std::vector<std::string>::const_iterator it=list.begin(); it!=list.end(); ++it)
{
ArticleDefinition *article = rule->getUfopaediaArticle(*it);
if (isArticleAvailable(save, article) && article->section != UFOPAEDIA_NOT_AVAILABLE)
{
articles.push_back(article);
}
}
return articles;
}
示例4: getAvailableArticles
/**
* Return an ArticleList with all the currently visible ArticleIds.
* @param game Pointer to actual game.
*/
ArticleDefinitionList Ufopaedia::getAvailableArticles(Game *game)
{
std::vector<std::string> list = game->getRuleset()->getUfopaediaList();
ArticleDefinitionList articles;
for (std::vector<std::string>::iterator it=list.begin(); it!=list.end(); ++it)
{
ArticleDefinition *article = game->getRuleset()->getUfopaediaArticle(*it);
if (/*isArticleAvailable(game, *it) && */article->section != UFOPAEDIA_NOT_AVAILABLE)
{
articles.push_back(article);
}
}
return articles;
}