]> git.tdb.fi Git - r2c2.git/commitdiff
Generate an event for reaching each waypoint
authorMikko Rasa <tdb@tdb.fi>
Wed, 26 Mar 2014 20:36:37 +0000 (22:36 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 26 Mar 2014 20:36:37 +0000 (22:36 +0200)
source/libr2c2/trainrouter.cpp
source/libr2c2/trainrouter.h

index 2be3c8814fd14727d7ff3a5ffdbb8fc8458ffc0e..b388bb2be9bc1a1062f49ce6d41f7b3e8ee86382 100644 (file)
@@ -255,6 +255,8 @@ void TrainRouter::train_advanced(Block &block)
                                if(!wp.has_track(*t_iter))
                                {
                                        waypoints.erase(waypoints.begin());
+                                       signal_waypoint_reached.emit(&wp);
+                                       signal_event.emit(Message("waypoint-reached", &wp));
                                        break;
                                }
                                else if(!block.has_track(*t_iter))
index 9efc3a6001cf6bc811d101b8fb8a6b54b5f1e81e..4f620764fd8c1a679205f59bb49662ad0fc0d20a 100644 (file)
@@ -25,6 +25,7 @@ public:
 
        sigc::signal<void, const Route *> signal_route_changed;
        sigc::signal<void, const TrackChain *> signal_arrived;
+       sigc::signal<void, const TrackChain *> signal_waypoint_reached;
 
 private:
        struct Wait