/** * Set UPSaved index and open the new state. * @param game Pointer to actual game. * @param article Article definition of the article to open. */ void Ufopaedia::openArticle(Game *game, ArticleDefinition *article) { _current_index = getArticleIndex(game->getSavedGame(), game->getRuleset(), article->id); if (_current_index != (size_t) -1) { game->pushState(createArticleState(article)); } }
/** * Set UPSaved index and open the new state. * @param game Pointer to actual game. * @param article Article definition of the article to open. */ void Ufopaedia::openArticle(Game *game, ArticleDefinition *article) { _current_index = getArticleIndex(game, article->id); if (_current_index != (size_t) -1) { game->pushState(createArticleState(game, article, 0)); } }
/** * Checks if selected article_id is available -> if yes, open it. * Otherwise, open start state! * @param game Pointer to actual game. * @param article_id Article id to find. */ void Ufopaedia::openArticle(Game *game, std::string &article_id) { _current_index = getArticleIndex(game->getSavedGame(), game->getRuleset(), article_id); if (_current_index != (size_t) -1) { ArticleDefinition *article = game->getRuleset()->getUfopaediaArticle(article_id); game->pushState(createArticleState(article)); } }
/** * set the current index to an article in the list found by a definition object. * @param article Article definition of the selected article. */ void UfopaediaSaved::setCurrentArticle(ArticleDefinition *article) { _current_index = getArticleIndex(article->id); }
/** * Checks, if article id is in the visible list. * @param article_id Article id to find. * @returns true, if article id was found. */ bool UfopaediaSaved::isArticleAvailable(const std::string &article_id) { return (-1 != getArticleIndex(article_id)); }
/** * Set UPSaved index and open the new state. * @param game Pointer to actual game. * @param article Article definition of the article to open. */ void Ufopaedia::openArticle(Game *game, ArticleDefinition *article) { _current_index = getArticleIndex(game, article->id); game->pushState(createArticleState(game, article)); }