OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RuleResearch.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_RULERESEARCH_H
20 #define OPENXCOM_RULERESEARCH_H
21 
22 #include <string>
23 #include <vector>
24 #include <yaml-cpp/yaml.h>
25 
26 namespace OpenXcom
27 {
41 {
42  private:
43  std::string _name, _lookup;
44  int _cost, _points;
45  std::vector<std::string> _dependencies, _unlocks, _getOneFree, _requires;
46  bool _needItem;
47  int _listOrder;
48 public:
49  RuleResearch(const std::string & name);
51  void load(const YAML::Node& node, int listOrder);
53  int getCost() const;
55  const std::string & getName () const;
57  const std::vector<std::string> & getDependencies () const;
59  bool needItem() const;
61  const std::vector<std::string> & getUnlocked () const;
63  int getPoints() const;
65  const std::vector<std::string> & getGetOneFree() const;
67  const std::string getLookup () const;
69  const std::vector<std::string> & getRequirements() const;
71  int getListOrder() const;
72 };
73 }
74 
75 #endif
void load(const YAML::Node &node, int listOrder)
Loads the research from YAML.
Definition: RuleResearch.cpp:33
const std::vector< std::string > & getRequirements() const
Gets the requirements for this ResearchProject.
Definition: RuleResearch.cpp:127
int getListOrder() const
Gets the list weight for this research item.
Definition: RuleResearch.cpp:136
const std::vector< std::string > & getGetOneFree() const
Gets the list of ResearchProjects granted at random for free by this research.
Definition: RuleResearch.cpp:109
bool needItem() const
Checks if this ResearchProject needs a corresponding Item to be researched.
Definition: RuleResearch.cpp:82
const std::string & getName() const
Gets the research name.
Definition: RuleResearch.cpp:64
int getPoints() const
Gets the points earned for discovering this ResearchProject.
Definition: RuleResearch.cpp:100
const std::string getLookup() const
Gets what to look up in the ufopedia.
Definition: RuleResearch.cpp:118
int getCost() const
Gets time needed to discover this ResearchProject.
Definition: RuleResearch.cpp:55
Represents one research project.
Definition: RuleResearch.h:40
const std::vector< std::string > & getDependencies() const
Gets the research dependencies.
Definition: RuleResearch.cpp:73
const std::vector< std::string > & getUnlocked() const
Gets the list of ResearchProjects unlocked by this research.
Definition: RuleResearch.cpp:91