X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnetwork%2Fclient.cpp;h=ec8e408582a657f2f1a3b07576c56735c5fb0c12;hb=7b4155fa0581d7c5fe198e4fb1dea61fa0846eec;hp=7c583255b2b7b29f04b714c0590257f959c78afb;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/network/client.cpp b/source/network/client.cpp index 7c58325..ec8e408 100644 --- a/source/network/client.cpp +++ b/source/network/client.cpp @@ -1,3 +1,4 @@ +#include #include "client.h" using namespace std; @@ -5,7 +6,7 @@ using namespace Msp; namespace R2C2 { -Client::Client(const Catalogue &c): +Client::Client(Catalogue &c): catalogue(c), socket(0), comm(0), @@ -56,10 +57,7 @@ void Client::set_halt(bool h) NetTrain &Client::get_train(unsigned addr) const { - map::const_iterator i = trains.find(addr); - if(i==trains.end()) - throw KeyError("Unknown train"); - return *i->second; + return *get_item(trains, addr); } void Client::receive(const DriverStatePacket &pkt)