X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcatalogue.h;h=d529cfc07969e18f8c17983359aadc5cd543e45b;hb=378f04522aa762729c0d5651fb60ad7e4d8ba9f3;hp=6277158df699246952fe29e5286c6bd3bb02f60f;hpb=52cbe8d99669f843f8f75c51128e2748584dd03a;p=r2c2.git diff --git a/source/libmarklin/catalogue.h b/source/libmarklin/catalogue.h index 6277158..d529cfc 100644 --- a/source/libmarklin/catalogue.h +++ b/source/libmarklin/catalogue.h @@ -1,34 +1,72 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef LIBMARKLIN_CATALOGUE_H_ #define LIBMARKLIN_CATALOGUE_H_ #include #include +#include "layout.h" +#include "profile.h" namespace Marklin { class TrackType; +class VehicleType; class Catalogue { public: - class Loader: public Msp::DataFile::Loader + class Loader: public Msp::DataFile::BasicLoader { public: Loader(Catalogue &); private: - Catalogue &cat; - + void ballast_profile(); + void gauge(float); + void layout(); + void rail_profile(); + void scale(float, float); void track(unsigned); + void vehicle(unsigned); }; + + 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::map tracks; + std::map vehicles; + Layout layout; public: + Catalogue(); ~Catalogue(); - TrackType &get_track(unsigned); + float get_scale() const { return scale; } + float get_gauge() const { return gauge; } + 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; } + + void add_track(TrackType &); + const TrackType &get_track(unsigned) const; const std::map &get_tracks() const { return tracks; } - void load(const std::string &); + + void add_vehicle(VehicleType &); + const VehicleType &get_vehicle(unsigned) const; + const std::map &get_vehicles() const { return vehicles; } + + Layout &get_layout() { return layout; } }; } // namespace Marklin