OpenXcom  1.0
Open-source clone of the original X-Com
RuleTerrain.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 <vector>
21 #include <string>
22 #include <yaml-cpp/yaml.h>
23 #include "MapBlock.h"
24 
25 namespace OpenXcom
26 {
27 
28 class MapBlock;
29 class MapDataSet;
30 class MapData;
31 class Mod;
32 
40 {
41 private:
42  std::vector<MapDataSet*> _mapDataSets;
43  std::vector<MapBlock*> _mapBlocks;
44  std::string _name, _script;
45  std::vector<std::string> _civilianTypes, _music;
46  int _minDepth, _maxDepth, _ambience;
47  double _ambientVolume;
48 public:
49  RuleTerrain(const std::string &name);
50  ~RuleTerrain();
52  void load(const YAML::Node& node, Mod *mod);
54  std::string getName() const;
56  std::vector<MapBlock*> *getMapBlocks();
58  std::vector<MapDataSet*> *getMapDataSets();
60  MapBlock *getRandomMapBlock(int maxSizeX, int maxSizeY, int group, bool force = true);
62  MapBlock *getMapBlock(const std::string &name);
64  MapData *getMapData(unsigned int *id, int *mapDataSetID) const;
66  std::vector<std::string> getCivilianTypes() const;
68  int getMinDepth() const;
70  int getMaxDepth() const;
72  int getAmbience() const;
74  std::string getScript() const;
76  const std::vector<std::string> &getMusic() const;
77  double getAmbientVolume() const;
78 };
79 
80 }
std::string getName() const
Gets the terrain&#39;s name (used for MAP generation).
Definition: RuleTerrain.cpp:121
int getMaxDepth() const
Gets the maximum depth.
Definition: RuleTerrain.cpp:224
Represents a Terrain Map Block.
Definition: MapBlock.h:37
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
MapData * getMapData(unsigned int *id, int *mapDataSetID) const
Gets the mapdata object.
Definition: RuleTerrain.cpp:177
MapBlock * getMapBlock(const std::string &name)
Gets a mapblock given its name.
Definition: RuleTerrain.cpp:161
MapBlock * getRandomMapBlock(int maxSizeX, int maxSizeY, int group, bool force=true)
Gets a random mapblock.
Definition: RuleTerrain.cpp:133
std::vector< MapDataSet * > * getMapDataSets()
Gets the terrain&#39;s mapdatafiles.
Definition: RuleTerrain.cpp:112
void load(const YAML::Node &node, Mod *mod)
Loads the terrain from YAML.
Definition: RuleTerrain.cpp:52
MapData is the smallest piece of a Battlescape terrain, holding info about a certain object...
Definition: MapData.h:51
std::string getScript() const
Gets the generation script name.
Definition: RuleTerrain.cpp:242
std::vector< std::string > getCivilianTypes() const
Gets the civilian types to use.
Definition: RuleTerrain.cpp:206
int getAmbience() const
Gets the ambient sound effect.
Definition: RuleTerrain.cpp:233
std::vector< MapBlock * > * getMapBlocks()
Gets the terrain&#39;s mapblocks.
Definition: RuleTerrain.cpp:103
RuleTerrain(const std::string &name)
RuleTerrain construction.
Definition: RuleTerrain.cpp:32
int getMinDepth() const
Gets the minimum depth.
Definition: RuleTerrain.cpp:215
~RuleTerrain()
Ruleterrain only holds mapblocks.
Definition: RuleTerrain.cpp:39
const std::vector< std::string > & getMusic() const
Gets the list of music to pick from.
Definition: RuleTerrain.cpp:251
Represents a specific type of Battlescape Terrain.
Definition: RuleTerrain.h:39
Definition: BaseInfoState.cpp:40