amount, cargoBundle);   return new AddTransactionMove(0, receipt, tp);
passengerAmount, passengerBundle, DeliverCargoReceipt.SUBCATEGORY_PASSENGERS); moves[0] = new AddTransactionMove(0, receipt, tp); receipt = new DeliverCargoReceipt(now, (long) freightAmount, freightBundle, DeliverCargoReceipt.SUBCATEGORY_FREIGHT); moves[1] = new AddTransactionMove(0, receipt, tp); return moves;
    public static AddTransactionMove processCargo(ReadOnlyWorld w,	CargoBundle cargoBundle, FreerailsPrincipal tp, int stationID,	FreerailsPrincipal sp) {	StationModel thisStation = (StationModel)w.get(KEY.STATIONS, stationID,		sp);        Iterator batches = cargoBundle.cargoBatchIterator();        int amountOfCargo = 0;        double amount = 0;	GameTime now = (GameTime) w.get(ITEM.TIME, tp);        while (batches.hasNext()) {            CargoBatch batch = (CargoBatch)((Entry) batches.next()).getKey();	    int dx = (batch.getSourceX() - thisStation.x);	    int dy = (batch.getSourceY() - thisStation.y);            double dist = Math.sqrt(dx*dx + dy*dy);	    int elapsedTime = now.getTime() - (int) batch.getTimeCreated();	    CargoType ct = (CargoType) w.get(KEY.CARGO_TYPES,		    batch.getCargoType(), Player.AUTHORITATIVE);            amount += cargoBundle.getAmount(batch) * Math.log(1 + dist) *		ct.getAgeAdjustedValue(elapsedTime);        }        DeliverCargoReceipt receipt = new DeliverCargoReceipt(now, (long)		amount, cargoBundle);	/* credit owner of the train for cargo delivery */        return new AddTransactionMove(0, receipt, tp);    }