#define LIBR2C2_TRACKTYPE_H_
#include <msp/datafile/objectloader.h>
-#include "articlenumber.h"
#include "geometry.h"
#include "objecttype.h"
#include "trackpart.h"
class Loader: public Msp::DataFile::DerivedObjectLoader<TrackType, ObjectType::Loader>
{
+ public:
+ typedef Msp::DataFile::Collection Collection;
+
private:
+ Collection &coll;
bool state_bits_set;
public:
- Loader(TrackType &);
+ Loader(TrackType &, Collection &);
+
+ virtual Collection &get_collection() const { return coll; }
private:
virtual void finish();
+ void appearance(const std::string &);
void part();
- void position(float, float, float);
void state_bits(unsigned);
};
private:
- const TrackAppearance &appearance;
+ const TrackAppearance *appearance;
std::vector<TrackPart> parts;
std::vector<Endpoint> endpoints;
unsigned state_bits;
std::string object;
public:
- TrackType(const ArticleNumber &, const TrackAppearance &);
+ TrackType();
- const TrackAppearance &get_appearance() const { return appearance; }
+ const TrackAppearance &get_appearance() const;
+ float get_gauge() const;
float get_total_length() const;
float get_path_length(int) const;
unsigned get_paths() const;
unsigned get_n_paths() const;
+ unsigned coerce_path(unsigned, unsigned) const;
unsigned get_state_bits() const { return state_bits; }
bool is_turnout() const;
bool is_dead_end() const;