if (pe.isDoomed()) { continue; }
    private void resolveMechWarriorPickUp() {        // fetch all mechWarriors that are not picked up        Enumeration mechWarriors =            game.getSelectedEntities( new EntitySelector() {                public boolean accept(Entity entity) {                    if (entity instanceof MechWarrior) {                        MechWarrior mw = (MechWarrior)entity;                        if (mw.getPickedUpById() == Entity.NONE) {                            return true;                        }                    }                    return false;                }            } );        // loop through them, check if they are in a hex occupied by another        // unit        while ( mechWarriors.hasMoreElements() ) {            boolean pickedUp = false;            MechWarrior e = (MechWarrior) mechWarriors.nextElement();            Enumeration pickupEntities = game.getEntities(e.getPosition());            while (pickupEntities.hasMoreElements() ) {                Entity pe = (Entity) pickupEntities.nextElement();                if (!pickedUp && pe.getOwnerId() == e.getOwnerId() && pe.getId() != e.getId()) {                    // Pick up the unit.                    pe.pickUp(e);                    // The picked unit is being carried by the loader.                    e.setPickedUpById(pe.getId());                    e.setPickedUpByExternalId(pe.getExternalId());                    pickedUp = true;                    phaseReport.append(e.getDisplayName()).append(" has been picked up by ")                         .append(pe.getDisplayName()).append(".\n");                }            }            if (!pickedUp) {                Enumeration pickupEnemyEntities = game.getEnemyEntities(e.getPosition(), e);                while (pickupEnemyEntities.hasMoreElements() ) {                    Entity pe = (Entity) pickupEnemyEntities.nextElement();                    if (!pickedUp) {                        // Capture the unit.                        pe.pickUp(e);                        // The captured unit is being carried by the loader.                        e.setCaptured( true );                        e.setPickedUpById(pe.getId());                        e.setPickedUpByExternalId(pe.getExternalId());                        pickedUp = true;                        phaseReport.append(e.getDisplayName()).append(" has been picked up by ")                        .append(pe.getDisplayName()).append(".\n");                    }                }            }            if (pickedUp) {                // Remove the picked-up unit from the screen.                e.setPosition( null );                // Update the loaded unit.                this.entityUpdate( e.getId() );            }        }    }