]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/catalogue.h
Correctly handle slope when snapping tracks
[r2c2.git] / source / libmarklin / catalogue.h
index 6277158df699246952fe29e5286c6bd3bb02f60f..4ce6fb1b712de8daa3d32f988d5ec5d43f0b6623 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2009  Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
 #ifndef LIBMARKLIN_CATALOGUE_H_
 #define LIBMARKLIN_CATALOGUE_H_
 
 
 namespace Marklin {
 
+class LocoType;
 class TrackType;
 
 class Catalogue
 {
 public:
-       class Loader: public Msp::DataFile::Loader
+       class Loader: public Msp::DataFile::BasicLoader<Catalogue>
        {
        public:
                Loader(Catalogue &);
        private:
-               Catalogue &cat;
-
+               void locomotive(unsigned);
                void track(unsigned);
        };
+
 private:
        std::map<unsigned, TrackType *> tracks;
+       std::map<unsigned, LocoType *> locos;
 
 public:
        ~Catalogue();
 
-       TrackType &get_track(unsigned);
+       TrackType &get_track(unsigned) const;
        const std::map<unsigned, TrackType *> &get_tracks() const { return tracks; }
-       void  load(const std::string &);
+       LocoType &get_locomotive(unsigned) const;
+       const std::map<unsigned, LocoType *> &get_locomotives() const { return locos; }
 };
 
 } // namespace Marklin