Enumeration misc = target.getMisc(); while ( misc.hasMoreElements() ) { final Mounted equip = (Mounted) misc.nextElement();
for (Mounted equip:target.getMisc()) {
    private void processAttack(Entity entity, Vector vector) {        // Not **all** actions take up the entity's turn.        boolean setDone =            !(game.getTurn() instanceof GameTurn.TriggerAPPodTurn);        for (Enumeration i = vector.elements(); i.hasMoreElements();) {            EntityAction ea = (EntityAction)i.nextElement();            // is this the right entity?            if (ea.getEntityId() != entity.getId()) {                System.err.println("error: attack packet has wrong attacker");                continue;            }            // Anti-mech and pointblank attacks from            // hiding may allow the target to respond.            if ( ea instanceof WeaponAttackAction ) {                final WeaponAttackAction waa = (WeaponAttackAction) ea;                final String weaponName = entity.getEquipment                    ( waa.getWeaponId() ).getType().getInternalName();                if ( Infantry.SWARM_MEK.equals(weaponName) ||                     Infantry.LEG_ATTACK.equals(weaponName) ) {                    // Does the target have any AP Pods available?                    final Entity target = game.getEntity( waa.getTargetId() );                    Enumeration misc = target.getMisc();                    while ( misc.hasMoreElements() ) {                        final Mounted equip = (Mounted) misc.nextElement();                        if ( equip.getType().hasFlag(MiscType.F_AP_POD) &&                             equip.canFire()) {                            // Yup.  Insert a game turn to handle AP pods.                            // ASSUMPTION : AP pod declarations come                            // immediately after the attack declaration.                            game.insertNextTurn( new GameTurn.TriggerAPPodTurn                                  ( target.getOwnerId(), target.getId() ) );                            send(createTurnVectorPacket());                            // We can stop looking.                            break;                        } // end found-available-ap-pod                    } // Check the next piece of equipment on the target.                } // End check-for-available-ap-pod            }            // The equipment type of a club needs to be restored.            if (ea instanceof ClubAttackAction) {                ClubAttackAction caa = (ClubAttackAction) ea;                Mounted club = caa.getClub();                club.restore();            }            if (ea instanceof PushAttackAction) {                // push attacks go the end of the displacement attacks                PushAttackAction paa = (PushAttackAction)ea;                entity.setDisplacementAttack(paa);                game.addCharge(paa);            } else if (ea instanceof DodgeAction) {                entity.dodging = true;            } else if (ea instanceof SpotAction) {                entity.setSpotting(true);            } else {                // add to the normal attack list.                game.addAction(ea);            }            // Mark any AP Pod as used in this turn.            if ( ea instanceof TriggerAPPodAction ) {                TriggerAPPodAction tapa = (TriggerAPPodAction) ea;                Mounted pod = entity.getEquipment( tapa.getPodId() );                pod.setUsedThisRound( true );            }        }        // Unless otherwise stated,        // this entity is done for the round.        if ( setDone ) {            entity.setDone(true);        }        entityUpdate(entity.getId());        // update all players on the attacks.  Don't worry about pushes being a        // "charge" attack.  It doesn't matter to the client.        send(createAttackPacket(vector, 0));    }