OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents one research project. More...
#include <RuleResearch.h>
Public Member Functions | |
void | load (const YAML::Node &node, int listOrder) |
Loads the research from YAML. More... | |
int | getCost () const |
Gets time needed to discover this ResearchProject. More... | |
const std::string & | getName () const |
Gets the research name. More... | |
const std::vector< std::string > & | getDependencies () const |
Gets the research dependencies. More... | |
bool | needItem () const |
Checks if this ResearchProject needs a corresponding Item to be researched. More... | |
const std::vector< std::string > & | getUnlocked () const |
Gets the list of ResearchProjects unlocked by this research. More... | |
int | getPoints () const |
Gets the points earned for discovering this ResearchProject. More... | |
const std::vector< std::string > & | getGetOneFree () const |
Gets the list of ResearchProjects granted at random for free by this research. More... | |
const std::string | getLookup () const |
Gets what to look up in the ufopedia. More... | |
const std::vector< std::string > & | getRequirements () const |
Gets the requirements for this ResearchProject. More... | |
int | getListOrder () const |
Gets the list weight for this research item. More... | |
Represents one research project.
Dependency is the list of RuleResearchs which must be discovered before a RuleResearch became available. Unlocks are used to immediately unlock a RuleResearch (even if not all the dependencies have been researched).
Fake ResearchProjects: A RuleResearch is fake one, if its cost is 0. They are used to to create check points in the dependency tree.
For example, if we have a Research E which needs either A & B or C & D, we create two fake research projects:
int OpenXcom::RuleResearch::getCost | ( | ) | const |
Gets time needed to discover this ResearchProject.
Gets the cost of this ResearchProject.
const std::vector< std::string > & OpenXcom::RuleResearch::getDependencies | ( | ) | const |
Gets the research dependencies.
Gets the list of dependencies, i.e.
ResearchProjects, that must be discovered before this one.
const std::vector< std::string > & OpenXcom::RuleResearch::getGetOneFree | ( | ) | const |
Gets the list of ResearchProjects granted at random for free by this research.
int OpenXcom::RuleResearch::getListOrder | ( | ) | const |
Gets the list weight for this research item.
const std::string OpenXcom::RuleResearch::getLookup | ( | ) | const |
Gets what to look up in the ufopedia.
Gets what article to look up in the ufopedia.
const std::string & OpenXcom::RuleResearch::getName | ( | ) | const |
Gets the research name.
Gets the name of this ResearchProject.
int OpenXcom::RuleResearch::getPoints | ( | ) | const |
Gets the points earned for discovering this ResearchProject.
Get the points earned for this ResearchProject.
const std::vector< std::string > & OpenXcom::RuleResearch::getRequirements | ( | ) | const |
Gets the requirements for this ResearchProject.
const std::vector< std::string > & OpenXcom::RuleResearch::getUnlocked | ( | ) | const |
Gets the list of ResearchProjects unlocked by this research.
void OpenXcom::RuleResearch::load | ( | const YAML::Node & | node, |
int | listOrder | ||
) |
Loads the research from YAML.
Loads the research project from a YAML file.
node | YAML node. |
listOrder | The list weight for this research. |
bool OpenXcom::RuleResearch::needItem | ( | ) | const |
Checks if this ResearchProject needs a corresponding Item to be researched.