public Base getClosestBase(int x, int y) throws NoBasesLeftException {
		Base b = null;
		Iterator<GameElement> iterator = elements.iterator();
		while (iterator.hasNext()) {
			Base base = (Base) iterator.next();
			if (b == null || b.distanceBase(x, y) > base.distanceBase(x, y))
				b = base;
		}
		if (b == null) {
			throw new NoBasesLeftException();
		}
		return b;
	}