- map<unsigned, LocoType *>::const_iterator i=locos.find(art_nr);
- if(i==locos.end())
- throw KeyError("Unknown locomotive type");
+ if(vehicles.count(veh.get_article_number()))
+ throw Exception("Duplicate vehicle type");
+
+ vehicles[veh.get_article_number()] = &veh;
+ signal_vehicle_added.emit(veh);
+}
+
+const VehicleType &Catalogue::get_vehicle(unsigned art_nr) const
+{
+ map<unsigned, VehicleType *>::const_iterator i = vehicles.find(art_nr);
+ if(i==vehicles.end())
+ throw KeyError("Unknown vehicle type");