]> 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 11ecc9551b3a013aff96e86d9ffc7cc614ec9336..293783f112d8f914dcc027c903c16c4b8d1ae841 100644 (file)
@@ -1,7 +1,14 @@
+/* $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_
 
-#include "section.h"
+#include "block.h"
 #include "train.h"
 
 namespace Marklin {
@@ -12,17 +19,25 @@ 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;
+
        TrafficManager(Control &, Layout &);
+       ~TrafficManager();
+
        Control &get_control() const { return control; }
-       Section *get_section_by_track(const Track *) const;
+       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;
-       SectionSeq sections;
-       TrainSeq trains;
-
        void turnout_route_changed(unsigned, Turnout *);
 };