/** * Given a list of MovePaths, applies adjustTowardsDesiredAltitude to each of them. * @param startingPaths The collection of paths to process * @return The new collection of resulting paths. */ protected List<MovePath> getAltitudeAdjustedPaths(List<MovePath> startingPaths) { List<MovePath> desiredAltitudes = new ArrayList<MovePath>(); for(MovePath start : startingPaths) { boolean choppedOffFlyOff = false; // if we are going off board, we need to take some special actions, meaning chopping off the tail end if(start.fliesOffBoard()) { start.removeLastStep(); choppedOffFlyOff = true; } // repeat with 1, 3, 7 when we settle things down? MovePath desiredAltitudePath = adjustTowardsDesiredAltitude(start, OPTIMAL_STRIKE_ALTITUDE); if(choppedOffFlyOff) { desiredAltitudePath.addStep(MoveStepType.RETURN); } desiredAltitudes.add(desiredAltitudePath); } return desiredAltitudes; }
mp.removeLastStep(); mp.removeLastStep();
private void removeLastStep() { cmd.removeLastStep(); if (cmd.length() == 0) { clear(); if ((gear == MovementDisplay.GEAR_JUMP) && (!cmd.isJumping())) { cmd.addStep(MoveStepType.START_JUMP); } else if (ce().isConvertingNow()) { cmd.addStep(MoveStepType.CONVERT_MODE); } } else { clientgui.bv.drawMovementData(ce(), cmd); clientgui.bv.setWeaponFieldofFire(ce(), cmd); // Set the button's label to "Done" // if the entire move is impossible. MovePath possible = cmd.clone(); possible.clipToPossible(); if (possible.length() == 0) { butDone.setText("<html><b>" + Messages.getString("MovementDisplay.Done") + "</b></html>"); //$NON-NLS-1$ } } updateButtons(); }
.getType() == MoveStepType.RECOVER) || (lastStep .getType() == MoveStepType.UNDOCK))) { md.removeLastStep();
cmd.removeLastStep(); .getType() == MoveStepType.CLIMB_MODE_OFF))) { MoveStep lastStep = cmd.getLastStep(); cmd.removeLastStep();
md.removeLastStep(); if(game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_RETURN_FLYOVER)) {
cmd.removeLastStep(); cmd.addStep(MoveStepType.CHARGE); cmd.removeLastStep(); cmd.addStep(MoveStepType.DFA);