]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/catalogue.h
Convert Catalogue to a Collection
[r2c2.git] / source / libr2c2 / catalogue.h
1 #ifndef LIBR2C2_CATALOGUE_H_
2 #define LIBR2C2_CATALOGUE_H_
3
4 #include <map>
5 #include <msp/datafile/collection.h>
6 #include "articlenumber.h"
7 #include "layout.h"
8 #include "trackappearance.h"
9
10 namespace R2C2 {
11
12 class ObjectType;
13
14 class Catalogue: public Msp::DataFile::Collection
15 {
16 public:
17         class Loader: public Msp::DataFile::Collection::Loader
18         {
19         private:
20                 Catalogue &cat;
21
22         public:
23                 Loader(Catalogue &);
24         private:
25                 void layout();
26                 void scale(float, float);
27                 void signal(const std::string &);
28                 void terrain(const std::string &);
29                 void track(const std::string &);
30                 void track_appearance();
31                 void vehicle(const std::string &);
32         };
33
34 private:
35         float scale;
36         TrackAppearance appearance;
37         Layout layout;
38
39 public:
40         Catalogue();
41
42         float get_scale() const { return scale; }
43         Layout &get_layout() { return layout; }
44 };
45
46 } // namespace R2C2
47
48 #endif