]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/tracktype.cpp
Rework article numbers
[r2c2.git] / source / libr2c2 / tracktype.cpp
index c2740f1d39b33ccfe10f819863ea26da220544f8..51b685f5ceed7964e54bf6ef26b84b3a83f41a89 100644 (file)
@@ -1,4 +1,5 @@
 #include <cmath>
+#include <msp/datafile/collection.h>
 #include <msp/geometry/union.h>
 #include "trackappearance.h"
 #include "tracktype.h"
@@ -8,9 +9,8 @@ using namespace Msp;
 
 namespace R2C2 {
 
-TrackType::TrackType(const ArticleNumber &an, const TrackAppearance *ta):
-       ObjectType(an),
-       appearance(ta),
+TrackType::TrackType():
+       appearance(0),
        state_bits(0),
        autofit_preference(1)
 { }
@@ -221,10 +221,12 @@ TrackType::Endpoint::Endpoint(float x, float y, const Angle &d, unsigned p):
 { }
 
 
-TrackType::Loader::Loader(TrackType &t):
+TrackType::Loader::Loader(TrackType &t, Collection &c):
        DataFile::DerivedObjectLoader<TrackType, ObjectType::Loader>(t),
+       coll(c),
        state_bits_set(false)
 {
+       add("appearance",  &TrackType::appearance);
        add("autofit_preference", &TrackType::autofit_preference);
        add("object",      &TrackType::object);
        add("state_bits",  &Loader::state_bits);