OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RuleTerrain.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_RULETERRAIN_H
20 #define OPENXCOM_RULETERRAIN_H
21 
22 #include <vector>
23 #include <string>
24 #include <yaml-cpp/yaml.h>
25 #include "MapBlock.h"
26 
27 namespace OpenXcom
28 {
29 
30 class MapBlock;
31 class MapDataSet;
32 class MapData;
33 class Ruleset;
34 
42 {
43 private:
44  std::vector<MapDataSet*> _mapDataSets;
45  std::vector<MapBlock*> _mapBlocks;
46  std::string _name;
47  int _largeBlockLimit;
48  std::vector<int> _textures, _roadTypeOdds;
49  std::vector<std::string> _civilianTypes;
50  int _hemisphere;
51 public:
52  RuleTerrain(const std::string &name);
53  ~RuleTerrain();
55  void load(const YAML::Node& node, Ruleset *ruleset);
57  std::string getName() const;
59  std::vector<MapBlock*> *getMapBlocks();
61  std::vector<MapDataSet*> *getMapDataSets();
63  MapBlock *getRandomMapBlock(int maxsize, MapBlockType type, bool force = false);
65  MapBlock *getMapBlock(const std::string &name);
67  MapData *getMapData(int *id, int *mapDataSetID) const;
69  int getLargeBlockLimit() const;
70  void resetMapBlocks();
71  std::vector<int> *getTextures();
72  int getHemisphere() const;
74  std::vector<std::string> getCivilianTypes() const;
76  std::vector<int> getRoadTypeOdds() const;
77 
78 };
79 
80 }
81 
82 #endif
std::vector< int > * getTextures()
Gets the array of globe texture IDs this terrain is loaded on.
Definition: RuleTerrain.cpp:213
int getLargeBlockLimit() const
Gets the maximum amount of large blocks in this terrain.
Definition: RuleTerrain.cpp:193
Represents a Terrain Map Block.
Definition: MapBlock.h:37
std::string getName() const
Gets the terrain's name (used for MAP generation).
Definition: RuleTerrain.cpp:111
MapBlock * getMapBlock(const std::string &name)
Gets a mapblock given its name.
Definition: RuleTerrain.cpp:155
void load(const YAML::Node &node, Ruleset *ruleset)
Loads the terrain from YAML.
Definition: RuleTerrain.cpp:52
std::vector< std::string > getCivilianTypes() const
Gets teh civilian types to use.
Definition: RuleTerrain.cpp:232
std::vector< MapDataSet * > * getMapDataSets()
Gets the terrain's mapdatafiles.
Definition: RuleTerrain.cpp:102
Set of rules and stats for a game.
Definition: Ruleset.h:69
void resetMapBlocks()
Resets the remaining uses of each mapblock.
Definition: RuleTerrain.cpp:201
MapBlock * getRandomMapBlock(int maxsize, MapBlockType type, bool force=false)
Gets a random mapblock.
Definition: RuleTerrain.cpp:123
std::vector< int > getRoadTypeOdds() const
Gets road type odds.
Definition: RuleTerrain.cpp:241
MapData is the smallest piece of a Battlescape terrain, holding info about a certain object...
Definition: MapData.h:52
MapData * getMapData(int *id, int *mapDataSetID) const
Gets the mapdata object.
Definition: RuleTerrain.cpp:171
std::vector< MapBlock * > * getMapBlocks()
Gets the terrain's mapblocks.
Definition: RuleTerrain.cpp:93
RuleTerrain(const std::string &name)
RuleTerrain construction.
Definition: RuleTerrain.cpp:32
~RuleTerrain()
Ruleterrain only holds mapblocks.
Definition: RuleTerrain.cpp:39
int getHemisphere() const
Gets the hemishpere this terrain occurs on.
Definition: RuleTerrain.cpp:223
Represents a specific type of Battlescape Terrain.
Definition: RuleTerrain.h:41