-/* $Id$
-
-This file is part of R²C²
-Copyright © 2009-2011 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
+#include <msp/core/maputils.h>
#include "client.h"
using namespace std;
NetTrain &Client::get_train(unsigned addr) const
{
- map<unsigned, NetTrain *>::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)