NetTrain::NetTrain(Client &c, const TrainInfoPacket &pkt):
client(c),
- loco_type(client.get_catalogue().get_locomotive(pkt.loco_type)),
+ loco_type(client.get_catalogue().get_vehicle(pkt.loco_type)),
address(pkt.address),
name(pkt.name),
functions(0)
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;