public static Location extractTarget(AIUnit aiUnit, PathNode path) {
        if (path == null) return null;
        final Unit unit = aiUnit.getUnit();
        final Location loc = path.getLastNode().getLocation();
        Settlement settlement = loc.getSettlement();
        Tile tile = loc.getTile();
        Unit other = (tile == null) ? null : tile.getDefendingUnit(unit);
        return (aiUnit.hasCargo())
            ? ((loc instanceof Europe) ? loc
                : (settlement instanceof Colony) ? settlement
                : null)
            : ((other != null) ? other : null);
    }