2 #include "terraintype.h"
9 TerrainType::TerrainType():
11 elevation_granularity(0.1)
14 const TerrainType::SurfaceType &TerrainType::get_surface_type(unsigned i) const
16 if(i>=surface_types.size())
17 throw out_of_range("TerrainType::get_surface_type");
18 return surface_types[i];
22 TerrainType::SurfaceType::SurfaceType():
29 TerrainType::Loader::Loader(TerrainType &tt):
30 DataFile::DerivedObjectLoader<TerrainType, ObjectType::Loader>(tt)
32 add("elevation_granularity", &TerrainType::elevation_granularity);
33 add("surface", &Loader::surface);
34 add("tile_size", &TerrainType::tile_size);
37 void TerrainType::Loader::surface()
41 obj.surface_types.push_back(srf);
45 TerrainType::SurfaceType::Loader::Loader(SurfaceType &st):
46 DataFile::ObjectLoader<SurfaceType>(st)