]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/block.h
Add networking library and a remote control program
[r2c2.git] / source / libmarklin / block.h
index 568d1736dbd85228d707559aed803f0056e546fa..770a3520289227830b37d40df45ce1d12ca83cc8 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2009  Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
 #ifndef MARKLIN_3D_BLOCK_H_
 #define MARKLIN_3D_BLOCK_H_
 
@@ -15,9 +22,9 @@ class Block
 public:
        struct Endpoint
        {
-               Track    *track;
+               Track *track;
                unsigned track_ep;
-               Block    *link;
+               Block *link;
                unsigned routes;
 
                Endpoint(Track *, unsigned);
@@ -25,16 +32,18 @@ public:
 
 private:
        TrafficManager &trfc_mgr;
-       unsigned       id;
-       unsigned       sensor_id;
-       std::set<Track *>     tracks;
+       unsigned id;
+       unsigned sensor_id;
+       unsigned turnout_id;
+       std::set<Track *> tracks;
        std::vector<Endpoint> endpoints;
-       const Train    *train;
+       const Train *train;
 
 public:
        Block(TrafficManager &, Track &);
 
        unsigned get_sensor_id() const { return sensor_id; }
+       unsigned get_turnout_id() const { return turnout_id; }
        const std::set<Track *> &get_tracks() const { return tracks; }
        const std::vector<Endpoint> &get_endpoints() const { return endpoints; }
        int get_endpoint_by_link(const Block &) const;