/** * "Worker" function to determine whether the path being examined is an intermediate path. * This means that the path, as is, is not a valid path, but its children may be. * This mainly applies to aero paths that have not used all their velocity. * @param path The move path to consider. * @return Whether it is an intermediate path or not. */ @Override protected boolean isIntermediatePath(MovePath path) { return path.getFinalVelocityLeft() > 0; }
/** * Worker function to determine whether we should discard the current path * (due to it being illegal or redundant) or keep generating child nodes * @param path The move path to consider * @return Whether to keep or dicsard. */ @Override protected boolean discardPath(MovePath path, CoordsWithFacing pathDestination) { boolean maxMPExceeded = path.getMpUsed() > path.getEntity().getRunMP(); // having generated the child, we add it and (recursively) any of its children to the list of children to be returned // unless it moves too far or exceeds max thrust if(path.getFinalVelocityLeft() < 0 || maxMPExceeded) { return true; } // terminator conditions: // we've visited this hex already and the path we are considering is longer than the previous path that visited this hex if(visitedCoords.containsKey(pathDestination) && visitedCoords.get(pathDestination).intValue() < path.getMpUsed()) { return true; } // there's no reason to consider off-board paths in the standard flight model. if(!path.getGame().getBoard().contains(pathDestination.getCoords())) { return true; } return false; } }
int velFirst = first.getFinalVelocityLeft(); int velSecond = second.getFinalVelocityLeft();
mp.getFinalVelocityLeft() > 1) { result.add(mp.clone().addStep(MoveStepType.DEC)); if(mp.getFinalVelocityLeft() > 0) { result.add(mp.clone().addStep(MoveStepType.FORWARDS));
while(straightLine.getFinalVelocityLeft() > 0 && game.getBoard().contains(straightLine.getFinalCoords())) {
protected void ForwardToTheEnd(MovePath mp) { while(mp.getFinalVelocityLeft() > 0) {