OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RuleManufacture.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_RULEMANUFACTURE_H
20 #define OPENXCOM_RULEMANUFACTURE_H
21 
22 #include <string>
23 #include <map>
24 #include <yaml-cpp/yaml.h>
25 
26 namespace OpenXcom
27 {
28 
33 {
34 private:
35  std::string _name, _category;
36  std::vector<std::string> _requires;
37  int _space, _time, _cost;
38  std::map<std::string, int> _requiredItems, _producedItems;
39  int _listOrder;
40 public:
42  RuleManufacture(const std::string &name);
44  void load(const YAML::Node& node, int listOrder);
46  std::string getName () const;
48  std::string getCategory () const;
50  const std::vector<std::string> &getRequirements () const;
52  int getRequiredSpace () const;
54  int getManufactureTime () const;
56  int getManufactureCost () const;
58  const std::map<std::string, int> & getRequiredItems() const;
61  const std::map<std::string, int> & getProducedItems() const;
63  int getListOrder() const;
64 };
65 
66 }
67 #endif
int getManufactureTime() const
Gets the time required to manufacture one object.
Definition: RuleManufacture.cpp:102
const std::map< std::string, int > & getRequiredItems() const
Gets the list of items required to manufacture one object.
Definition: RuleManufacture.cpp:121
const std::vector< std::string > & getRequirements() const
Gets the manufacture's requirements.
Definition: RuleManufacture.cpp:84
int getListOrder() const
Gets the list weight for this manufacture item.
Definition: RuleManufacture.cpp:139
RuleManufacture(const std::string &name)
Creates a new manufacture.
Definition: RuleManufacture.cpp:27
int getRequiredSpace() const
Gets the required workshop space.
Definition: RuleManufacture.cpp:93
const std::map< std::string, int > & getProducedItems() const
Gets the list of items produced by completing "one object" of this project. by default: it contains o...
Definition: RuleManufacture.cpp:130
std::string getCategory() const
Gets the manufacture category.
Definition: RuleManufacture.cpp:74
int getManufactureCost() const
Gets the cost of manufacturing one object.
Definition: RuleManufacture.cpp:112
std::string getName() const
Gets the manufacture name.
Definition: RuleManufacture.cpp:65
void load(const YAML::Node &node, int listOrder)
Loads the manufacture from YAML.
Definition: RuleManufacture.cpp:37
Represents the information needed to manufacture an object.
Definition: RuleManufacture.h:32