OpenXcom  1.0
Open-source clone of the original X-Com
RuleManufacture.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <string>
21 #include <map>
22 #include <yaml-cpp/yaml.h>
23 
24 namespace OpenXcom
25 {
26 
31 {
32 private:
33  std::string _name, _category;
34  std::vector<std::string> _requires;
35  int _space, _time, _cost;
36  std::map<std::string, int> _requiredItems, _producedItems;
37  int _listOrder;
38 public:
40  RuleManufacture(const std::string &name);
42  void load(const YAML::Node& node, int listOrder);
44  std::string getName() const;
46  std::string getCategory() const;
48  const std::vector<std::string> &getRequirements() const;
50  int getRequiredSpace() const;
52  int getManufactureTime() const;
54  int getManufactureCost() const;
56  const std::map<std::string, int> & getRequiredItems() const;
59  const std::map<std::string, int> & getProducedItems() const;
61  int getListOrder() const;
62 };
63 
64 }
std::string getName() const
Gets the manufacture name.
Definition: RuleManufacture.cpp:65
std::string getCategory() const
Gets the manufacture category.
Definition: RuleManufacture.cpp:74
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
const std::map< std::string, int > & getRequiredItems() const
Gets the list of items required to manufacture one object.
Definition: RuleManufacture.cpp:121
int getManufactureTime() const
Gets the time required to manufacture one object.
Definition: RuleManufacture.cpp:102
void load(const YAML::Node &node, int listOrder)
Loads the manufacture from YAML.
Definition: RuleManufacture.cpp:37
int getManufactureCost() const
Gets the cost of manufacturing one object.
Definition: RuleManufacture.cpp:112
const std::vector< std::string > & getRequirements() const
Gets the manufacture&#39;s requirements.
Definition: RuleManufacture.cpp:84
int getRequiredSpace() const
Gets the required workshop space.
Definition: RuleManufacture.cpp:93
Represents the information needed to manufacture an object.
Definition: RuleManufacture.h:30
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
Definition: BaseInfoState.cpp:40