/** * Searches the movement path for the first step that has the given position and sets it as * a VTOL bombing step. If found, any previous bombing step is cleared. If the coordinates are not * part of the path nothing is changed. * * @param pos The <code>Coords</code> of the hex to be bombed. * @return Whether the position was found in the movement path */ public boolean setVTOLBombStep(Coords pos) { boolean foundPos = false; MoveStep prevBombing = null; for (MoveStep step : steps) { if (step.getPosition().equals(pos)) { if (step.isVTOLBombingStep()) { return true; } else { step.setVTOLBombing(true); foundPos = true; } } else if (step.isVTOLBombingStep()) { prevBombing = step; } } if (foundPos && prevBombing != null) { prevBombing.setVTOLBombing(false); } return foundPos; }