]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/sensor.h
Don't crash if a train has no router
[r2c2.git] / source / libr2c2 / sensor.h
index 849f899a9687d1be8d3e6a3f12992753917e8c08..24f0fff401184c471186a33b146b5bdcce78897a 100644 (file)
@@ -6,6 +6,7 @@
 
 namespace R2C2 {
 
+class Block;
 class Layout;
 
 class Sensor: public sigc::trackable
@@ -24,6 +25,8 @@ public:
 protected:
        Layout &layout;
        unsigned address;
+       unsigned id;
+       bool invert;
        State state;
        Msp::Time::TimeDelta state_confirm_timeout;
 
@@ -31,8 +34,10 @@ protected:
 public:
        virtual ~Sensor();
 
+       virtual void set_address(unsigned);
        unsigned get_address() const { return address; }
        State get_state() const { return state; }
+       virtual Block *get_block() const { return 0; }
 
        void tick(const Msp::Time::TimeDelta &);