private void blockCarsFromStaging() throws BuildFailedException {
  if (_departStageTrack == null || !_departStageTrack.isBlockCarsEnabled()) {
    return;
  }
  addLine(_buildReport,THREE,BLANK_LINE);
  addLine(_buildReport,THREE,MessageFormat.format(Bundle.getMessage("blockDepartureHasBlocks"),new Object[]{_departStageTrack.getName(),_numOfBlocks.size()}));
  Enumeration<String> en=_numOfBlocks.keys();
  while (en.hasMoreElements()) {
    String locId=en.nextElement();
    int numCars=_numOfBlocks.get(locId);
    String locName="";
    Location l=locationManager.getLocationById(locId);
    if (l != null) {
      locName=l.getName();
    }
    addLine(_buildReport,SEVEN,MessageFormat.format(Bundle.getMessage("blockFromHasCars"),new Object[]{locId,locName,numCars}));
    if (_numOfBlocks.size() < 2) {
      addLine(_buildReport,SEVEN,Bundle.getMessage("blockUnable"));
      return;
    }
  }
  blockByLocationMoves();
  addLine(_buildReport,SEVEN,MessageFormat.format(Bundle.getMessage("blockDone"),new Object[]{_departStageTrack.getName()}));
}

private void blockCarsFromStaging ( ) throws BuildFailedException { if ( _departStageTrack == null || ! _departStageTrack . isBlockCarsEnabled ( ) ) { return ; } addLine ( _buildReport , THREE , BLANK_LINE ) ; addLine ( _buildReport , THREE , MessageFormat . format ( Bundle . getMessage ( "blockDepartureHasBlocks" ) , new Object [ ] { _departStageTrack . getName ( ) , _numOfBlocks . size ( ) } ) ) ; Enumeration < String > en = _numOfBlocks . keys ( ) ; while ( en . hasMoreElements ( ) ) { String locId = en . nextElement ( ) ; int numCars = _numOfBlocks . get ( locId ) ; String locName = "" ; Location l = locationManager . getLocationById ( locId ) ; if ( l != null ) { locName = l . getName ( ) ; } addLine ( _buildReport , SEVEN , MessageFormat . format ( Bundle . getMessage ( "blockFromHasCars" ) , new Object [ ] { locId , locName , numCars } ) ) ; if ( _numOfBlocks . size ( ) < 2 ) { addLine ( _buildReport , SEVEN , Bundle . getMessage ( "blockUnable" ) ) ; return ; } } blockByLocationMoves ( ) ; addLine ( _buildReport , SEVEN , MessageFormat . format ( Bundle . getMessage ( "blockDone" ) , new Object [ ] { _departStageTrack . getName ( ) } ) ) ; }
block cars departing staging . no guarantee that cars departing staging can be blocked by destination . by using the pick up location id , this routine tries to find destinations that are willing to accepts all of the cars that were " blocked " together when they were picked up . rules : the route must allow set outs at the destination . the route must allow the correct number of set outs . the destination must accept all cars in the pick up block .
