OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MapDataSet.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_MAPDATASET_H
20 #define OPENXCOM_MAPDATASET_H
21 
22 #include <string>
23 #include <vector>
24 #include <SDL.h>
25 #include <yaml-cpp/yaml.h>
26 
27 namespace OpenXcom
28 {
29 
30 class MapData;
31 class SurfaceSet;
32 class ResourcePack;
33 
41 {
42 private:
43  std::string _name;
44  std::vector<MapData*> _objects;
45  SurfaceSet *_surfaceSet;
46  bool _loaded;
47  static MapData *_blankTile;
48  static MapData *_scorchedTile;
49 public:
50  MapDataSet(const std::string &name);
51  ~MapDataSet();
53  void load(const YAML::Node& node);
55  static void loadLOFTEMPS(const std::string &filename, std::vector<Uint16> *voxelData);
57  std::string getName() const;
59  size_t getSize() const;
61  std::vector<MapData*> *getObjects();
63  SurfaceSet *getSurfaceset() const;
65  void loadData();
67  void unloadData();
69  static MapData *getBlankFloorTile();
71  static MapData *getScorchedEarthTile();
72 };
73 
74 }
75 
76 #endif
static MapData * getBlankFloorTile()
Gets a blank floor tile.
Definition: MapDataSet.cpp:297
~MapDataSet()
MapDataSet destruction.
Definition: MapDataSet.cpp:44
MapDataSet(const std::string &name)
MapDataSet construction.
Definition: MapDataSet.cpp:37
static void loadLOFTEMPS(const std::string &filename, std::vector< Uint16 > *voxelData)
Loads voxeldata from a DAT file.
Definition: MapDataSet.cpp:268
Container of a set of surfaces.
Definition: SurfaceSet.h:38
SurfaceSet * getSurfaceset() const
Gets the surfaces in this dataset.
Definition: MapDataSet.cpp:92
std::string getName() const
Gets the dataset name (used for MAP generation).
Definition: MapDataSet.cpp:65
MapData is the smallest piece of a Battlescape terrain, holding info about a certain object...
Definition: MapData.h:52
void unloadData()
Unloads to free memory.
Definition: MapDataSet.cpp:249
size_t getSize() const
Gets the dataset size.
Definition: MapDataSet.cpp:74
std::vector< MapData * > * getObjects()
Gets the objects in this dataset.
Definition: MapDataSet.cpp:83
static MapData * getScorchedEarthTile()
Gets a scorched earth tile.
Definition: MapDataSet.cpp:306
void loadData()
Loads the objects from an MCD file.
Definition: MapDataSet.cpp:101
Represents a Terrain Map Datafile.
Definition: MapDataSet.h:40
void load(const YAML::Node &node)
Loads the map data set from YAML.
Definition: MapDataSet.cpp:53