]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/trackpart.h
Add state loading and saving to engineer
[r2c2.git] / source / libmarklin / trackpart.h
index 5aa4b0c8b0a487084ba310c37341a21ed34b0c6c..de449b3a59e05e5d4c6c873b9ff8400a3db66396 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -10,26 +10,22 @@ Distributed under the GPL
 
 #include <msp/datafile/loader.h>
 #include "endpoint.h"
+#include "geometry.h"
 
 namespace Marklin {
 
 struct TrackPart
 {
-       class Loader: public Msp::DataFile::Loader
+       class Loader: public Msp::DataFile::BasicLoader<TrackPart>
        {
-       private:
-               TrackPart &part;
-
        public:
                Loader(TrackPart &);
-               TrackPart &get_object() { return part; }
        private:
                virtual void finish();
-
                void start(float, float, float);
        };
 
-       float    x, y;
+       Point    pos;
        float    dir;
        float    length;
        float    radius;
@@ -38,7 +34,8 @@ struct TrackPart
 
        TrackPart();
 
-       void collect_endpoints(std::vector<Endpoint> &);
+       void collect_endpoints(std::vector<Endpoint> &) const;
+       Point get_point(float) const;
 };
 
 } // namespace Marklin