xoreos  0.0.5
tileset.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_NWN_TILESET_H
26 #define ENGINES_NWN_TILESET_H
27 
28 #include <vector>
29 
30 #include "src/common/types.h"
31 #include "src/common/ustring.h"
32 
33 namespace Common {
34  class ConfigFile;
35  class ConfigDomain;
36 }
37 
38 namespace Engines {
39 
40 namespace NWN {
41 
42 class Tileset {
43 public:
44  struct Tile {
46  };
47 
48  Tileset(const Common::UString &resRef);
49  ~Tileset();
50 
51  const Common::UString &getName() const;
52  const Common::UString &getEnvironmentMap() const;
53 
54  float getTilesHeight() const;
55 
56  const Tile &getTile(size_t n) const;
57 
58 private:
61 
63 
64  float _tilesHeight;
65 
66  std::vector<Tile> _tiles;
67 
68  void load(const Common::ConfigFile &set);
69 
70  void loadGeneral(const Common::ConfigDomain &general);
71  void loadTile(const Common::ConfigFile &set, uint i, Tile &tile);
72 };
73 
74 } // End of namespace NWN
75 
76 } // End of namespace Engines
77 
78 #endif // ENGINES_NWN_TILESET_H
void load(const Common::ConfigFile &set)
Definition: tileset.cpp:74
Common::UString _resRef
Definition: tileset.h:59
This class allows reading/writing INI style config files.
Definition: configfile.h:113
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
void loadGeneral(const Common::ConfigDomain &general)
Definition: tileset.cpp:91
Common::UString model
Definition: tileset.h:45
std::vector< Tile > _tiles
Definition: tileset.h:66
Common::UString _environmentMap
Definition: tileset.h:62
Low-level type definitions to handle fixed width types portably.
const Common::UString & getEnvironmentMap() const
Definition: tileset.cpp:59
void loadTile(const Common::ConfigFile &set, uint i, Tile &tile)
Definition: tileset.cpp:98
Unicode string handling.
Tileset(const Common::UString &resRef)
Definition: tileset.cpp:40
const Common::UString & getName() const
Definition: tileset.cpp:55
Accessor for a domain (section) in a config file.
Definition: configfile.h:46
Common::UString _name
Definition: tileset.h:60
float getTilesHeight() const
Definition: tileset.cpp:63
const Tile & getTile(size_t n) const
Definition: tileset.cpp:67
unsigned int uint
Definition: types.h:211