]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/catalogue.h
Get rid of some obsolete #includes
[r2c2.git] / source / libr2c2 / catalogue.h
index 73ad4e8e5694949d2de20fd597df1b7cb7320fb4..46cdb5fb21c150d2d10c974b4969569b65d176af 100644 (file)
@@ -1,73 +1,44 @@
 #ifndef LIBR2C2_CATALOGUE_H_
 #define LIBR2C2_CATALOGUE_H_
 
-#include <map>
-#include <msp/datafile/loader.h>
-#include "articlenumber.h"
+#include <msp/datafile/collection.h>
+#include <msp/datafile/collectionsource.h>
+#include <msp/fs/path.h>
 #include "layout.h"
-#include "profile.h"
 
 namespace R2C2 {
 
-class TrackType;
-class VehicleType;
+class ObjectType;
 
-class Catalogue
+class Catalogue: public Msp::DataFile::Collection
 {
 public:
-       class Loader: public Msp::DataFile::BasicLoader<Catalogue>
+       class Loader: public Msp::DataFile::Collection::Loader
        {
+       private:
+               Catalogue &cat;
+
        public:
                Loader(Catalogue &);
        private:
-               void ballast_profile();
-               void gauge(float);
                void layout();
-               void rail_profile();
                void scale(float, float);
-               void track(unsigned);
-               void track(ArticleNumber);
-               void vehicle(unsigned);
-               void vehicle(ArticleNumber);
        };
 
-       typedef std::map<ArticleNumber, TrackType *> TrackMap;
-       typedef std::map<ArticleNumber, VehicleType *> VehicleMap;
-
-       sigc::signal<void, const TrackType &> signal_track_added;
-       sigc::signal<void, const VehicleType &> signal_vehicle_added;
+       sigc::signal<void, Msp::DataFile::CollectionSource &> signal_source_added;
 
 private:
        float scale;
-       float gauge;
-       Profile rail_profile;
-       Profile ballast_profile;
-       Profile path_profile;
-       std::string track_technique;
-       TrackMap tracks;
-       VehicleMap vehicles;
        Layout layout;
+       std::list<Msp::DataFile::CollectionSource *> sources;
 
 public:
        Catalogue();
-       ~Catalogue();
 
-       float get_scale() const { return scale; }
-       float get_gauge() const { return gauge; }
-       float get_rail_elevation() const;
-       const Profile &get_rail_profile() const { return rail_profile; }
-       const Profile &get_ballast_profile() const { return ballast_profile; }
-       const Profile &get_path_profile() const { return path_profile; }
-       const std::string &get_track_technique() const { return track_technique; }
-
-       void add_track(TrackType &);
-       const TrackType &get_track(const ArticleNumber &) const;
-       const TrackMap &get_tracks() const { return tracks; }
-
-       void add_vehicle(VehicleType &);
-       const VehicleType &get_vehicle(const ArticleNumber &) const;
-       const VehicleMap &get_vehicles() const { return vehicles; }
+       void add_source(const Msp::FS::Path &);
+       const std::list<Msp::DataFile::CollectionSource *> &get_sources() const { return sources; }
 
+       float get_scale() const { return scale; }
        Layout &get_layout() { return layout; }
 };