OpenXcom
1.0
Open-source clone of the original X-Com
|
This static class encapsulates all functions related to Ufopaedia for the game. More...
#include <Ufopaedia.h>
Static Public Member Functions | |
static bool | isArticleAvailable (SavedGame *save, ArticleDefinition *article) |
check, if a specific article is currently available. More... | |
static void | openArticle (Game *game, std::string &article_id) |
open Ufopaedia on a certain entry. More... | |
static void | openArticle (Game *game, ArticleDefinition *article) |
open Ufopaedia article from a given article definition. More... | |
static void | open (Game *game) |
open Ufopaedia with selection dialog. More... | |
static void | next (Game *game) |
article navigation to next article. More... | |
static void | prev (Game *game) |
article navigation to previous article. More... | |
static void | list (SavedGame *save, Ruleset *rule, const std::string §ion, ArticleDefinitionList &data) |
load a vector with article ids that are currently visible of a given section. More... | |
Static Protected Member Functions | |
static size_t | getArticleIndex (SavedGame *save, Ruleset *rule, std::string &article_id) |
get index of the given article id in the visible list. More... | |
static ArticleDefinitionList | getAvailableArticles (SavedGame *save, Ruleset *rule) |
get list of researched articles More... | |
static ArticleState * | createArticleState (Game *game, ArticleDefinition *article) |
create a new state object from article definition. More... | |
Static Protected Attributes | |
static size_t | _current_index = 0 |
current selected article index (for prev/next navigation). | |
This static class encapsulates all functions related to Ufopaedia for the game.
It manages the relationship between the UfopaediaSaved instance in SavedGame and the UfopaediaFactory in Ruleset. Main purpose is to open Ufopaedia from Geoscape, navigate between articles and release new articles after successful research.
|
staticprotected |
create a new state object from article definition.
Creates a new article state dependent on the given article definition.
game | Pointer to actual game. |
article | Article definition to create from. |
|
staticprotected |
get index of the given article id in the visible list.
Gets the index of the selected article_id in the visible list.
If the id is not found, returns -1.
save | Pointer to saved game. |
rule | Pointer to ruleset. |
article_id | Article id to find. |
|
staticprotected |
get list of researched articles
Return an ArticleList with all the currently visible ArticleIds.
save | Pointer to saved game. |
rule | Pointer to ruleset. |
|
static |
check, if a specific article is currently available.
Checks, if an article has already been released.
save | Pointer to saved game. |
article | Article definition to release. |
|
static |
load a vector with article ids that are currently visible of a given section.
Fill an ArticleList with the currently visible ArticleIds of the given section.
save | Pointer to saved game. |
rule | Pointer to ruleset. |
section | Article section to find, e.g. "XCOM Crafts & Armaments", "Alien Lifeforms", etc. |
data | Article definition list object to fill data in. |
|
static |
article navigation to next article.
Open the next article in the list.
Loops to the first.
game | Pointer to actual game. |
|
static |
|
static |
open Ufopaedia on a certain entry.
Checks if selected article_id is available -> if yes, open it.
Otherwise, open start state!
game | Pointer to actual game. |
article_id | Article id to find. |
|
static |
open Ufopaedia article from a given article definition.
Set UPSaved index and open the new state.
game | Pointer to actual game. |
article | Article definition of the article to open. |
|
static |
article navigation to previous article.
Open the previous article in the list.
Loops to the last.
game | Pointer to actual game. |