public boolean canLoad(Entity unit,boolean checkElev){
  if (this instanceof Infantry) {
    return false;
  }
  if (!unit.isEnemyOf(this)) {
    Enumeration<Transporter> iter=transports.elements();
    while (iter.hasMoreElements()) {
      Transporter next=iter.nextElement();
      if (next.canLoad(unit) && (!checkElev || (unit.getElevation() == getElevation()))) {
        return true;
      }
    }
  }
  return false;
}

public boolean canLoad ( Entity unit , boolean checkElev ) { if ( this instanceof Infantry ) { return false ; } if ( ! unit . isEnemyOf ( this ) ) { Enumeration < Transporter > iter = transports . elements ( ) ; while ( iter . hasMoreElements ( ) ) { Transporter next = iter . nextElement ( ) ; if ( next . canLoad ( unit ) && ( ! checkElev || ( unit . getElevation ( ) == getElevation ( ) ) ) ) { return true ; } } } return false ; }
determines if this object can accept the given unit . the unit may not be of the appropriate type or there may be no room for the unit .
