]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/terraintype.h
Rework article numbers
[r2c2.git] / source / libr2c2 / terraintype.h
1 #ifndef LIBR2C2_TERRAINTYPE_H_
2 #define LIBR2C2_TERRAINTYPE_H_
3
4 #include <vector>
5 #include "objecttype.h"
6
7 namespace R2C2 {
8
9 class TerrainType: public ObjectType
10 {
11 public:
12         class Loader: public Msp::DataFile::DerivedObjectLoader<TerrainType, ObjectType::Loader>
13         {
14         public:
15                 Loader(TerrainType &);
16
17         private:
18                 void surface();
19         };
20
21         struct SurfaceType
22         {
23                 class Loader: public Msp::DataFile::ObjectLoader<SurfaceType>
24                 {
25                 public:
26                         Loader(SurfaceType &);
27                 };
28
29                 float r, g, b;
30
31                 SurfaceType();
32         };
33
34 private:
35         std::vector<SurfaceType> surface_types;
36         float tile_size;
37         float elevation_granularity;
38
39 public:
40         TerrainType();
41
42         unsigned get_n_surface_types() const { return surface_types.size(); }
43         const SurfaceType &get_surface_type(unsigned) const;
44         float get_tile_size() const { return tile_size; }
45         float get_elevation_granularity() const { return elevation_granularity; }
46 };
47
48 } // namespace R2C2
49
50 #endif