public Landmark returnClosestLandmark(Coords fromCoords, int landmarkType, Landmark fromLandmark) {
boolean skipFlag = false;
PathFinder pathfinder = new PathFinder(fromCoords, this);
Landmark bestLandmark = null;
int bestResult = 999999999;
if (fromLandmark != null) {
skipFlag = true;
}
for (Landmark l : landmarks) {
Log.info("Found: " + l.ofType + "; Looking for: " + landmarkType);
if ((skipFlag == false) && (l.ofType == landmarkType)) {
pathfindingGoalX = l.mapCoords.getIntX();
pathfindingGoalY = l.mapCoords.getIntY();
pathfinder.goalX = l.mapCoords.getIntX();
pathfinder.goalY = l.mapCoords.getIntY();
pathfinder.updatePath();
if (pathfinder.path != null) {
//Log.info("Path exists");
if (pathfinder.path.getLength() < bestResult) {
//Log.info("Path is optimal");