X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fcatalogue.h;h=e8a474432251adfafec5e514fb794a93575e6942;hb=81ee4fbd16b472892b67b35ea85956423a2247ed;hp=73ad4e8e5694949d2de20fd597df1b7cb7320fb4;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/libr2c2/catalogue.h b/source/libr2c2/catalogue.h index 73ad4e8..e8a4744 100644 --- a/source/libr2c2/catalogue.h +++ b/source/libr2c2/catalogue.h @@ -2,72 +2,44 @@ #define LIBR2C2_CATALOGUE_H_ #include -#include +#include #include "articlenumber.h" #include "layout.h" -#include "profile.h" +#include "trackappearance.h" namespace R2C2 { -class TrackType; -class VehicleType; +class ObjectType; -class Catalogue +class Catalogue: public Msp::DataFile::Collection { public: - class Loader: public Msp::DataFile::BasicLoader + 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); + void signal(const std::string &); + void terrain(const std::string &); + void track(const std::string &); + void track_appearance(); + void vehicle(const std::string &); }; - typedef std::map TrackMap; - typedef std::map VehicleMap; - - sigc::signal signal_track_added; - sigc::signal signal_vehicle_added; - private: float scale; - float gauge; - Profile rail_profile; - Profile ballast_profile; - Profile path_profile; - std::string track_technique; - TrackMap tracks; - VehicleMap vehicles; + TrackAppearance appearance; Layout layout; 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; } - Layout &get_layout() { return layout; } };