]> git.localhorst.tv Git - blobs.git/blob - src/world/TileSet.hpp
slightly better planet
[blobs.git] / src / world / TileSet.hpp
1 #ifndef BLOBS_WORLD_TILESET_HPP_
2 #define BLOBS_WORLD_TILESET_HPP_
3
4 #include <map>
5 #include <string>
6 #include <vector>
7
8 namespace blobs {
9 namespace world {
10
11 class TileType;
12
13 class TileSet {
14
15 public:
16         TileSet();
17         ~TileSet();
18
19         TileSet(const TileSet &) = delete;
20         TileSet &operator =(const TileSet &) = delete;
21
22         TileSet(TileSet &&) = delete;
23         TileSet &operator =(TileSet &&) = delete;
24
25 public:
26         int Add(const TileType &);
27
28         TileType &operator [](int id) noexcept { return types[id]; }
29         const TileType &operator [](int id) const noexcept { return types[id]; }
30
31         TileType &operator [](const std::string &name);
32         const TileType &operator [](const std::string &name) const;
33
34 private:
35         std::vector<TileType> types;
36         std::map<std::string, int> names;
37
38 };
39
40 }
41 }
42
43 #endif