X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcatalogue.h;h=641b6f8b13c3ea15275a987cdd76a8eff71035f5;hb=48dff17ed3144d944965e7cb534e1f8fb92bd620;hp=1a328bba1a70431b7486b55e3b78762a4049d8b0;hpb=6c61179fe09af2f5366d50f10aadbf5f83438087;p=r2c2.git diff --git a/source/libmarklin/catalogue.h b/source/libmarklin/catalogue.h index 1a328bb..641b6f8 100644 --- a/source/libmarklin/catalogue.h +++ b/source/libmarklin/catalogue.h @@ -1,33 +1,70 @@ +/* $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 +#include "layout.h" +#include "profile.h" namespace Marklin { -class Track; +class LocoType; +class TrackType; class Catalogue { public: - class Loader: public Msp::Parser::Loader + class Loader: public Msp::DataFile::BasicLoader { public: Loader(Catalogue &); private: - Catalogue &cat; - + void ballast_profile(); + void gauge(float); + void layout(); + void locomotive(unsigned); + void rail_profile(); + void scale(float, float); void track(unsigned); }; - typedef std::map TrackMap; - Track *get_track(unsigned); - const TrackMap &get_tracks() const { return tracks; } - void load(const std::string &); - ~Catalogue(); + sigc::signal signal_track_added; + sigc::signal signal_loco_added; + private: - TrackMap tracks; + float scale; + float gauge; + Profile rail_profile; + Profile ballast_profile; + std::map tracks; + std::map locos; + Layout layout; + +public: + Catalogue(); + ~Catalogue(); + + 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; } + + void add_track(TrackType &); + const TrackType &get_track(unsigned) const; + const std::map &get_tracks() const { return tracks; } + + void add_locomotive(LocoType &); + const LocoType &get_locomotive(unsigned) const; + const std::map &get_locomotives() const { return locos; } + + Layout &get_layout() { return layout; } }; } // namespace Marklin