]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/train.h
Place vehicles on the track when attached
[r2c2.git] / source / libmarklin / train.h
index f9ea6f17ae0001b39432e8cd83b57ac8fb4cf9ce..319119b93828fd745639a7a37b8c1ae3d6a69794 100644 (file)
@@ -12,15 +12,14 @@ Distributed under the GPL
 #include <sigc++/trackable.h>
 #include <msp/time/timestamp.h>
 #include "block.h"
+#include "controller.h"
 
 namespace Marklin {
 
-class ControlModel;
 class Route;
 class Timetable;
 class Vehicle;
 class VehicleType;
-struct TrainControl;
 
 class Train: public sigc::trackable
 {
@@ -79,7 +78,7 @@ private:
        std::list<BlockRef> cur_blocks;
        std::list<BlockRef> rsv_blocks;
        Block *pending_block;
-       ControlModel *control;
+       Controller *controller;
        Timetable *timetable;
        bool active;
        unsigned current_speed;
@@ -110,7 +109,7 @@ public:
        const std::string &get_name() const { return name; }
        void set_priority(int);
        int get_priority() const { return priority; }
-       ControlModel &get_control_model() const { return *control; }
+       Controller &get_controller() const { return *controller; }
 
        void add_vehicle(const VehicleType &);
        void remove_vehicle(unsigned);
@@ -145,7 +144,7 @@ public:
 
        void save(std::list<Msp::DataFile::Statement> &) const;
 private:
-       void control_changed(const TrainControl &);
+       void control_changed(const Controller::Control &);
        void loco_speed_event(unsigned, unsigned, bool);
        void loco_func_event(unsigned, unsigned, bool);
        void sensor_event(unsigned, bool);