]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/trackcircuit.cpp
Don't crash if a train has no router
[r2c2.git] / source / libr2c2 / trackcircuit.cpp
1 #include <stdexcept>
2 #include "block.h"
3 #include "trackcircuit.h"
4
5 using namespace std;
6
7 namespace R2C2 {
8
9 TrackCircuit::TrackCircuit(Layout &l, Block &b):
10         Sensor(l),
11         block(b)
12 {
13         Sensor::set_address(block.get_sensor_address());
14 }
15
16 void TrackCircuit::set_address(unsigned)
17 {
18         throw logic_error("use Track::set_sensor_id");
19 }
20
21 } // namespace R2C2