]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/train.h
Full vehicle unification
[r2c2.git] / source / libmarklin / train.h
index 8087745f3dd29f03b9d3b3bfb4eec75859c246e8..e8785f5e5994deb4ae275e670a0187676dd03534 100644 (file)
@@ -16,10 +16,10 @@ Distributed under the GPL
 namespace Marklin {
 
 class ControlModel;
-class LocoType;
 class Route;
 class Timetable;
 class Vehicle;
+class VehicleType;
 
 class Train: public sigc::trackable
 {
@@ -28,6 +28,7 @@ public:
        {
        private:
                Block *prev_block;
+               bool blocks_valid;
 
        public:
                Loader(Train &);
@@ -68,7 +69,7 @@ private:
        };
 
        Layout &layout;
-       const LocoType &loco_type;
+       const VehicleType &loco_type;
        unsigned address;
        std::string name;
        int priority;
@@ -97,11 +98,11 @@ private:
        float overshoot_dist;
 
 public:
-       Train(Layout &, const LocoType &, unsigned);
+       Train(Layout &, const VehicleType &, unsigned);
        ~Train();
 
        Layout &get_layout() const { return layout; }
-       const LocoType &get_locomotive_type() const { return loco_type; }
+       const VehicleType &get_locomotive_type() const { return loco_type; }
        unsigned get_address() const { return address; }
        void set_name(const std::string &);
        const std::string &get_name() const { return name; }
@@ -109,6 +110,9 @@ public:
        int get_priority() const { return priority; }
        ControlModel &get_control() const { return *control; }
 
+       void add_vehicle(const VehicleType &);
+       void remove_vehicle(unsigned);
+       unsigned get_n_vehicles() const;
        Vehicle &get_vehicle(unsigned);
        const Vehicle &get_vehicle(unsigned) const;
 
@@ -120,6 +124,9 @@ public:
        bool get_function(unsigned) const;
        unsigned get_functions() const { return functions; }
 
+       void set_timetable(Timetable *);
+       Timetable *get_timetable() { return timetable; }
+
        void set_route(const Route *);
        void go_to(const Track &);
        const Route *get_route() const { return route; }