OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::RuleResearch Class Reference

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...
 

Detailed Description

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:

Member Function Documentation

int OpenXcom::RuleResearch::getCost ( ) const

Gets time needed to discover this ResearchProject.

Gets the cost of this ResearchProject.

Returns
The cost of this ResearchProject (in man/day).
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.

Returns
The list of ResearchProjects.
const std::vector< std::string > & OpenXcom::RuleResearch::getGetOneFree ( ) const

Gets the list of ResearchProjects granted at random for free by this research.

Returns
The list of ResearchProjects.
int OpenXcom::RuleResearch::getListOrder ( ) const

Gets the list weight for this research item.

Returns
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.

Returns
The article to look up in the ufopaedia
const std::string & OpenXcom::RuleResearch::getName ( ) const

Gets the research name.

Gets the name of this ResearchProject.

Returns
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.

Returns
The points earned for this ResearchProject.
const std::vector< std::string > & OpenXcom::RuleResearch::getRequirements ( ) const

Gets the requirements for this ResearchProject.

Returns
The requirement for this research.
const std::vector< std::string > & OpenXcom::RuleResearch::getUnlocked ( ) const

Gets the list of ResearchProjects unlocked by this research.

Returns
The list of ResearchProjects.
void OpenXcom::RuleResearch::load ( const YAML::Node &  node,
int  listOrder 
)

Loads the research from YAML.

Loads the research project from a YAML file.

Parameters
nodeYAML node.
listOrderThe list weight for this research.
bool OpenXcom::RuleResearch::needItem ( ) const

Checks if this ResearchProject needs a corresponding Item to be researched.

Returns
True if the ResearchProject needs a corresponding item.

The documentation for this class was generated from the following files: