]> git.tdb.fi Git - r2c2.git/blobdiff - source/network/train.cpp
Handle separate speed and reverse controls correctly in remote
[r2c2.git] / source / network / train.cpp
index 6a0c3a8b8fa99006c56275e9382618f05998b962..4b6c8e86e1233955d3d4d04b19b6e1d27c522670 100644 (file)
@@ -32,6 +32,12 @@ void NetTrain::set_control(const string &c, float v)
        client.send(pkt);
 }
 
+float NetTrain::get_control(const string &c) const
+{
+       map<string, float>::const_iterator i = controls.find(c);
+       return i!=controls.end() ? i->second : 0;
+}
+
 void NetTrain::set_function(unsigned i, bool set)
 {
        TrainFunctionPacket pkt;