OpenXcom  1.0
Open-source clone of the original X-Com
MapDataSet.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 <vector>
22 #include <SDL.h>
23 #include <yaml-cpp/yaml.h>
24 
25 namespace OpenXcom
26 {
27 
28 class MapData;
29 class SurfaceSet;
30 
38 {
39 private:
40  std::string _name;
41  std::vector<MapData*> _objects;
42  SurfaceSet *_surfaceSet;
43  bool _loaded;
44  static MapData *_blankTile;
45  static MapData *_scorchedTile;
46 public:
47  MapDataSet(const std::string &name);
48  ~MapDataSet();
50  void load(const YAML::Node& node);
52  static void loadLOFTEMPS(const std::string &filename, std::vector<Uint16> *voxelData);
54  std::string getName() const;
56  size_t getSize() const;
58  std::vector<MapData*> *getObjects();
60  SurfaceSet *getSurfaceset() const;
62  void loadData();
64  void unloadData();
66  static MapData *getBlankFloorTile();
68  static MapData *getScorchedEarthTile();
69 };
70 
71 }
static MapData * getBlankFloorTile()
Gets a blank floor tile.
Definition: MapDataSet.cpp:278
~MapDataSet()
MapDataSet destruction.
Definition: MapDataSet.cpp:43
MapDataSet(const std::string &name)
MapDataSet construction.
Definition: MapDataSet.cpp:36
std::string getName() const
Gets the dataset name (used for MAP generation).
Definition: MapDataSet.cpp:64
SurfaceSet * getSurfaceset() const
Gets the surfaces in this dataset.
Definition: MapDataSet.cpp:91
static void loadLOFTEMPS(const std::string &filename, std::vector< Uint16 > *voxelData)
Loads voxeldata from a DAT file.
Definition: MapDataSet.cpp:249
Container of a set of surfaces.
Definition: SurfaceSet.h:35
size_t getSize() const
Gets the dataset size.
Definition: MapDataSet.cpp:73
MapData is the smallest piece of a Battlescape terrain, holding info about a certain object...
Definition: MapData.h:51
void unloadData()
Unloads to free memory.
Definition: MapDataSet.cpp:230
std::vector< MapData * > * getObjects()
Gets the objects in this dataset.
Definition: MapDataSet.cpp:82
static MapData * getScorchedEarthTile()
Gets a scorched earth tile.
Definition: MapDataSet.cpp:287
void loadData()
Loads the objects from an MCD file.
Definition: MapDataSet.cpp:100
Represents a Terrain Map Datafile.
Definition: MapDataSet.h:37
Definition: BaseInfoState.cpp:40
void load(const YAML::Node &node)
Loads the map data set from YAML.
Definition: MapDataSet.cpp:52