private FulfillTrade canTradeFor(SpendType t) {
		Map<Resource, Integer> res = neededResources(t);
		if (res == null) return null;
		FulfillTrade ret = null, tr;
		int suited = 999999, st;
		List<Resource> to, from;
		int to_i, from_i, needed, net_gain;
		l0: for (int id : _trades.keySet()) {
			tr = _trades.get(id);
			st = 0;
			to = tr.getTo();
			from = tr.getFrom();
			for (Resource r : res.keySet()) {
				to_i = numResInList(r, to);
				from_i = numResInList(r, from);
				needed = res.get(r);
				net_gain = from_i - to_i;
				if (net_gain < 0 && ! hasNumRes(r, net_gain * -1)) continue l0;
				if (net_gain < 0 && needed > net_gain) continue l0;
				st += Math.abs(net_gain - needed);
			}
			if (st < suited) {
				ret = tr;
				suited = st;
			}
		}
		return ret;
	}