This static class encapsulates all functions related to Ufopaedia for the game.
More...
#include <Ufopaedia.h>
|
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.
◆ createArticleState()
create a new state object from article definition.
Creates a new article state dependent on the given article definition.
- Parameters
-
game | Pointer to actual game. |
article | Article definition to create from. |
- Returns
- Article state object if created, 0 otherwise.
◆ getArticleIndex()
size_t OpenXcom::Ufopaedia::getArticleIndex |
( |
SavedGame * |
save, |
|
|
Ruleset * |
rule, |
|
|
std::string & |
article_id |
|
) |
| |
|
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.
- Parameters
-
save | Pointer to saved game. |
rule | Pointer to ruleset. |
article_id | Article id to find. |
- Returns
- Index of the given article id in the internal list, -1 if not found.
◆ getAvailableArticles()
get list of researched articles
Return an ArticleList with all the currently visible ArticleIds.
- Parameters
-
save | Pointer to saved game. |
rule | Pointer to ruleset. |
- Returns
- List of visible ArticleDefinitions.
◆ isArticleAvailable()
check, if a specific article is currently available.
Checks, if an article has already been released.
- Parameters
-
save | Pointer to saved game. |
article | Article definition to release. |
- Returns
- true, if the article is available.
◆ list()
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.
- Parameters
-
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. |
◆ next()
void OpenXcom::Ufopaedia::next |
( |
Game * |
game | ) |
|
|
static |
article navigation to next article.
Open the next article in the list.
Loops to the first.
- Parameters
-
game | Pointer to actual game. |
◆ open()
void OpenXcom::Ufopaedia::open |
( |
Game * |
game | ) |
|
|
static |
open Ufopaedia with selection dialog.
Open Ufopaedia start state, presenting the section selection buttons.
- Parameters
-
game | Pointer to actual game. |
◆ openArticle() [1/2]
open Ufopaedia article from a given article definition.
Set UPSaved index and open the new state.
- Parameters
-
game | Pointer to actual game. |
article | Article definition of the article to open. |
◆ openArticle() [2/2]
void OpenXcom::Ufopaedia::openArticle |
( |
Game * |
game, |
|
|
std::string & |
article_id |
|
) |
| |
|
static |
open Ufopaedia on a certain entry.
Checks if selected article_id is available -> if yes, open it.
Otherwise, open start state!
- Parameters
-
game | Pointer to actual game. |
article_id | Article id to find. |
◆ prev()
void OpenXcom::Ufopaedia::prev |
( |
Game * |
game | ) |
|
|
static |
article navigation to previous article.
Open the previous article in the list.
Loops to the last.
- Parameters
-
game | Pointer to actual game. |
The documentation for this class was generated from the following files: