OpenXcom  1.0
Open-source clone of the original X-Com
RuleConverter.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 <map>
21 #include <vector>
22 #include <string>
23 #include <yaml-cpp/yaml.h>
24 
25 namespace OpenXcom
26 {
27 
34 {
35 private:
36  std::map<std::string, int> _offsets;
37  std::vector<std::string> _markers, _countries, _regions, _facilities, _items, _crews, _crafts, _ufos, _craftWeapons, _missions, _armor, _alienRaces, _alienRanks, _research, _manufacture, _ufopaedia;
38 public:
40  RuleConverter();
44  void load(const YAML::Node& node);
46  int getOffset(const std::string &id) { return _offsets[id]; }
48  const std::vector<std::string> &getMarkers() const { return _markers; }
50  const std::vector<std::string> &getCountries() const { return _countries; }
52  const std::vector<std::string> &getRegions() const { return _regions; }
54  const std::vector<std::string> &getFacilities() const { return _facilities; }
56  const std::vector<std::string> &getItems() const { return _items; }
58  const std::vector<std::string> &getCrews() const { return _crews; }
60  const std::vector<std::string> &getCrafts() const { return _crafts; }
62  const std::vector<std::string> &getUfos() const { return _ufos; }
64  const std::vector<std::string> &getCraftWeapons() const { return _craftWeapons; }
66  const std::vector<std::string> &getMissions() const { return _missions; }
68  const std::vector<std::string> &getArmor() const { return _armor; }
70  const std::vector<std::string> &getAlienRaces() const { return _alienRaces; }
72  const std::vector<std::string> &getAlienRanks() const { return _alienRanks; }
74  const std::vector<std::string> &getResearch() const { return _research; }
76  const std::vector<std::string> &getManufacture() const { return _manufacture; }
78  const std::vector<std::string> &getUfopaedia() const { return _ufopaedia; }
79 };
80 
81 }
const std::vector< std::string > & getCountries() const
Gets the country ID list.
Definition: RuleConverter.h:50
const std::vector< std::string > & getItems() const
Gets the item ID list.
Definition: RuleConverter.h:56
const std::vector< std::string > & getFacilities() const
Gets the facility ID list.
Definition: RuleConverter.h:54
const std::vector< std::string > & getRegions() const
Gets the region ID list.
Definition: RuleConverter.h:52
const std::vector< std::string > & getCrafts() const
Gets the craft ID list.
Definition: RuleConverter.h:60
Represents game-specific contents needed for save convertion and ID matching.
Definition: RuleConverter.h:33
const std::vector< std::string > & getResearch() const
Gets the research ID list.
Definition: RuleConverter.h:74
const std::vector< std::string > & getMissions() const
Gets the alien mission ID list.
Definition: RuleConverter.h:66
RuleConverter()
Creates a blank converter ruleset.
Definition: RuleConverter.cpp:27
const std::vector< std::string > & getArmor() const
Gets the armor ID list.
Definition: RuleConverter.h:68
const std::vector< std::string > & getAlienRaces() const
Gets the alien race ID list.
Definition: RuleConverter.h:70
int getOffset(const std::string &id)
Gets the offset for a specific attribute.
Definition: RuleConverter.h:46
~RuleConverter()
Cleans up the converter ruleset.
Definition: RuleConverter.cpp:34
const std::vector< std::string > & getManufacture() const
Gets the manufacture ID list.
Definition: RuleConverter.h:76
const std::vector< std::string > & getAlienRanks() const
Gets the alien rank ID list.
Definition: RuleConverter.h:72
const std::vector< std::string > & getUfopaedia() const
Gets the ufopaedia ID list.
Definition: RuleConverter.h:78
const std::vector< std::string > & getMarkers() const
Gets the marker ID list.
Definition: RuleConverter.h:48
const std::vector< std::string > & getUfos() const
Gets the UFO ID list.
Definition: RuleConverter.h:62
const std::vector< std::string > & getCrews() const
Gets the UFO crew ID list.
Definition: RuleConverter.h:58
void load(const YAML::Node &node)
Loads the converter from YAML.
Definition: RuleConverter.cpp:42
const std::vector< std::string > & getCraftWeapons() const
Gets the craft weapon ID list.
Definition: RuleConverter.h:64
Definition: BaseInfoState.cpp:40