AddTransactionMove payment =
AddTransactionMove payment[] =
    public void unloadTrain(ObjectKey trainKey, ObjectKey stationKey) {	TrainModel train = (TrainModel)w.get(trainKey.key, trainKey.index,		trainKey.principal);	int trainBundleId = train.getCargoBundleNumber();	CargoBundle trainBefore = (CargoBundle) w.get(KEY.CARGO_BUNDLES,		trainBundleId, Player.AUTHORITATIVE);	trainBefore = trainBefore.getCopy();	CargoBundle trainAfter = trainBefore.getCopy();	StationModel station = (StationModel) w.get(stationKey.key,		stationKey.index, stationKey.principal);	int stationBundleId = station.getCargoBundleNumber();	CargoBundle stationBefore = (CargoBundle) w.get(KEY.CARGO_BUNDLES,		stationBundleId, Player.AUTHORITATIVE);	stationBefore = stationBefore.getCopy();	CargoBundle stationAfter = stationBefore.getCopy();        Iterator batches = trainAfter.cargoBatchIterator();        CargoBundle cargoDroppedOff = new CargoBundleImpl();        //Unload the cargo that the station demands        while (batches.hasNext()) {            CargoBatch cb = (CargoBatch)((Entry) batches.next()).getKey();            //if the cargo is demanded.            DemandAtStation demand = station.getDemand();            int cargoType = cb.getCargoType();	    logger.log(Level.INFO, "Unloading cargo " + cargoType);            if (demand.isCargoDemanded(cargoType)) {                int amount = trainAfter.getAmount(cb);		cargoDroppedOff.addCargo(cb, amount);                //Now perform any conversions..                ConvertedAtStation converted = station.getConverted();                if (converted.isCargoConverted(cargoType)) {                    int newCargoType = converted.getConversion(cargoType);		    GameTime now = (GameTime) w.get(ITEM.TIME,			    Player.AUTHORITATIVE);                    CargoBatch newCargoBatch = new CargoBatch(newCargoType,                            station.x, station.y, now.getTime(),			    stationKey.index);                    stationAfter.addCargo(newCargoBatch, amount);                }                batches.remove();            }        }	AddTransactionMove payment =	    ProcessCargoAtStationMoveGenerator.processCargo(w,		    cargoDroppedOff, trainKey.principal, stationKey.index,		    stationKey.principal);	ChangeCargoBundleMove changeAtStation = new	    ChangeCargoBundleMove(stationBefore, stationAfter, stationBundleId);	ChangeCargoBundleMove changeOnTrain = new	    ChangeCargoBundleMove(trainBefore, trainAfter, trainBundleId);	logger.log(Level.FINE, "train " + trainKey.index + ": stationAfter = "		+ stationAfter + ", stationBefore = " + stationBefore +		", trainAfter = " + trainAfter + ", trainBefore = " +		trainBefore + ", dropped off = " + cargoDroppedOff);	logger.log(Level.FINE,"payment = " + payment);	moveReceiver.processMove(TransferCargoAtStationMove.generateMove		(changeAtStation, changeOnTrain, payment));    }