]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/trafficmanager.h
Support using a mesh as a background
[r2c2.git] / source / libmarklin / trafficmanager.h
index 9db94448a72ac9068a4d5c7a64eedf551403174f..293783f112d8f914dcc027c903c16c4b8d1ae841 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
 #ifndef LIBMARKLIN_TRAFFICMANAGER_H_
 #define LIBMARKLIN_TRAFFICMANAGER_H_
 
@@ -12,6 +19,12 @@ class Turnout;
 
 class TrafficManager
 {
+private:
+       Control &control;
+       Layout &layout;
+       std::list<Block *> blocks;
+       std::list<Train *> trains;
+
 public:
        sigc::signal<void, const Block &, const Train *> signal_block_reserved;
 
@@ -19,15 +32,12 @@ public:
        ~TrafficManager();
 
        Control &get_control() const { return control; }
-       Block *get_block_by_track(const Track *) const;
-       const TrainSeq &get_trains() const { return trains; }
+       const std::list<Block *> &get_blocks() const { return blocks; }
+       Block &get_block_by_track(const Track &) const;
+       const std::list<Train *> &get_trains() const { return trains; }
        void add_train(Train *);
+       void tick();
 private:
-       Control &control;
-       Layout &layout;
-       std::list<Block *> blocks;
-       std::list<Train *> trains;
-
        void turnout_route_changed(unsigned, Turnout *);
 };