- train=engineer.add_train(lexical_cast<unsigned>(ent_addr->get_text()));
- train->set_name(ent_name->get_text());
+ const map<unsigned, LocoType *> &locos = engineer.get_catalogue().get_locomotives();
+ map<unsigned, LocoType *>::const_iterator i = locos.begin();
+ advance(i, drp_type->get_selected_index());
+
+ unsigned addr = lexical_cast<unsigned>(ent_addr->get_text());
+ train = new Train(engineer.get_layout(), *i->second, addr);
+ engineer.place_train(*train);