/**
 * Oct 31, 2007
 * cs485.roomba:FoodFinderRobot.java
 * --------
 */
package edu.drexel.cs485.assign4;

import java.awt.Point;
import java.awt.geom.Point2D;
import java.io.IOException;

import cs485.roomba.Robot;
import edu.drexel.cs485.env.Environment;

/**
 * FoodFinderRobot
 * @author duc
 * 
 * Description: 
 * 
 */
public class FoodFinderRobot extends Robot{
	private boolean foundFood;
	private boolean home;
	private Environment environment;
	
	private Point currentLocation;
	
	/**
	 * @throws IOException
	 */
	public FoodFinderRobot() throws IOException {
		super();
		foundFood = false;
		home = false;
		environment = new Environment();
		currentLocation = new Point();
	}

	/* (non-Javadoc)
	 * @see cs485.roomba.Robot#run()
	 */
	@Override
	public void run() {
		
		findFood(currentLocation);
		
		//print out the environment
		environment.drawEnvironment();
	}
	
	/**
	 * @param double1
	 */
	private void findFood(Point currLocation) {
		if( hasFood(currentLocation) ){
			goHome();
			return;
		}
		
		//get next location
		Point2D nextlocation = getNextLocation(currLocation);
		
		//mark walls
		
		
		//leave pheromone in current location
		
		//move
		
		//repeat
	}

	/**
	 * @param currentLocation2
	 * @return
	 */
	private boolean hasFood(Point currentLocation2) {
		boolean retVal = false;
		// TODO Auto-generated method stub
		return false;
	}

	/**
	 * 
	 */
	private void goHome() {
		// TODO Auto-generated method stub
		
	}

	private Point2D getNextLocation(Point2D location){
		Point2D retVal = new Point2D.Double();
		
		
		
		return retVal;
	}

	/* (non-Javadoc)
	 * @see cs485.roomba.Robot#stopRobot()
	 */
	@Override
	protected void stopRobot() {
		// TODO Auto-generated method stub
		
	}

}
