/*************************************************************************
 * Driver the 2005 TIK2O Final Exam. Problem description can be found at *
 * http://www.rsgc.on.ca/darcy/TIK2O/Exams/2005FinalExamTIK2O.htm        *
 *************************************************************************/ 
import becker.robots.*;
import java.util.*;

public class RoadTrip {
	
	private static Random random = new Random();	// utility object for random quantities
	private static int fuel;											// amount of fuel vehicle has at any time
	private static int gasStationExit;						// Exit (avenue) to take for entrance to Gas Station
	private static int destinationExit;						// Exit (avenue) to take for destination
	
	public static void main (String [] args) {
		
		City city = new City();
	
		// create an instance of the gas station at a random location
		gasStationExit = random.nextInt(6);
		GasStation gasStation = new GasStation(city,gasStationExit);
		
		// create the walls for the destination at a randomly chosen exit,
		// relative to the gas station
		destinationExit = gasStationExit+3+random.nextInt(5);
		new Wall(city, destinationExit, 402, Directions.WEST);
		new Wall(city, destinationExit, 402, Directions.SOUTH);
		new Wall(city, destinationExit, 402, Directions.EAST);

		// Assign a random quantity of fuel for the vehicle that 
		// may, or may not, be sufficent to get it to it's destination
		fuel = destinationExit-1+random.nextInt(3);

		// instantiate the vehicle and the frame...
		Vehicle vehicle = new Vehicle(city,0,401,Directions.EAST,gasStation,destinationExit,fuel);
		CityFrame frame = new CityFrame(city,0,398,14,10);
		frame.setTitle("2005 TIK2O Final Exam: Road Trip");
	
		// used to show the litres remaining in the pump
		city.showThingCounts(true);
		
		// go to your Destination
		vehicle.goToDestination();
	}
	
	
}