]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/vehicletype.h
Add a common base class for tangible objects
[r2c2.git] / source / libr2c2 / vehicletype.h
index d8bec87a31a1ff9d47ddc2b702e26d1c190389f0..841664e375f10f61b079b52a535318c79cd4ea76 100644 (file)
@@ -2,15 +2,15 @@
 #define LIBR2C2_VEHICLETYPE_H_
 
 #include <msp/datafile/objectloader.h>
-#include "articlenumber.h"
 #include "geometry.h"
+#include "objecttype.h"
 
 namespace R2C2 {
 
-class VehicleType
+class VehicleType: public ObjectType
 {
 public:
-       class Loader: public Msp::DataFile::ObjectLoader<VehicleType>
+       class Loader: public Msp::DataFile::DerivedObjectLoader<VehicleType, ObjectType::Loader>
        {
        private:
                std::map<std::string, unsigned> rod_tags;
@@ -125,8 +125,6 @@ public:
        typedef std::map<unsigned, std::string> FunctionMap;
 
 private:
-       ArticleNumber art_nr;
-       std::string name;
        bool locomotive;
        FunctionMap functions;
        bool swap_direction;
@@ -142,8 +140,6 @@ private:
 public:
        VehicleType(const ArticleNumber &);
 
-       const ArticleNumber &get_article_number() const { return art_nr; }
-       const std::string &get_name() const { return name; }
        bool is_locomotive() const { return locomotive; }
        unsigned get_max_function() const;
        const FunctionMap &get_functions() const { return functions; }