import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class track
{
	//Initialize the images
	Image trackRoadDry = Toolkit.getDefaultToolkit().getImage("track_roaddry.jpg");
	Image trackRoadSnow = Toolkit.getDefaultToolkit().getImage("track_roadsnow.jpg");
	Image trackRoadWet = Toolkit.getDefaultToolkit().getImage("track_roadwet.jpg");

	Image trackDirtDry = Toolkit.getDefaultToolkit().getImage("track_dirtdry.jpg");
	Image trackDirtSnow = Toolkit.getDefaultToolkit().getImage("track_dirtsnow.jpg");
	Image trackDirtWet = Toolkit.getDefaultToolkit().getImage("track_dirtwet.jpg");

	Image trackJungleDry = Toolkit.getDefaultToolkit().getImage("track_jungledry.jpg");
	Image trackJungleSnow = Toolkit.getDefaultToolkit().getImage("track_junglesnow.jpg");
	Image trackJungleWet = Toolkit.getDefaultToolkit().getImage("track_junglewet.jpg");
	
	//Initialize the Arrays
	int[] trackNumber = new int[1];
	int trackPercent = 0;

	int trackType = 1;
	String trackName;
	int trackWeather = 1;
	String trackWeatherName;

	

	Image trackUsed = trackDirtSnow;

	public track()
	{
		trackNumber[0] = 1;
		changeTrack();
	}
	
	public void changeWeather(int input)
	{
		trackWeather = input;
		changeTrack();	

	}

	public void changeType(int input)
	{
		trackType = input;
		changeTrack();	

	}

	public void importTrack(int input)
	{
		switch (input)
		{
			case 1:
				trackType = 1;
				trackWeather = 1;
				break;
			case 2:
				trackType = 1;
				trackWeather = 2;
				break;
			case 3:
				trackType = 1;
				trackWeather = 3;
				break;
			case 4:
				trackType = 2;
				trackWeather = 1;
				break;
			case 5:
				trackType = 2;
				trackWeather = 2;
				break;
			case 6:
				trackType = 2;
				trackWeather = 3;
				break;
			case 7:
				trackType = 3;
				trackWeather = 1;
				break;
			case 8:
				trackType = 3;
				trackWeather = 2;
				break;
			case 9:
				trackType = 3;
				trackWeather = 3;
				break;
		}
		changeTrack();
	}

	public void changeTrack()
	{
		switch (trackType)
		{
			case 1:
				trackName = "Road";
				switch (trackWeather)
				{
					case 1:
						trackNumber[0] = 1;
						trackUsed = trackRoadDry;
						trackWeatherName = "Dry";
						break;
					case 2:
						trackNumber[0] = 2;
						trackUsed = trackRoadSnow;
						trackWeatherName = "Snow";
						break;
					case 3:
						trackNumber[0] = 3;
						trackUsed = trackRoadWet;
						trackWeatherName = "Wet";
						break;
				}
				break;
			
			case 2:
				trackName = "Dirt";
				switch (trackWeather)
				{
					case 1:
						trackNumber[0] = 4;
						trackUsed = trackDirtDry;
						trackWeatherName = "Dry";
						break;
					case 2:
						trackNumber[0] = 5;
						trackUsed = trackDirtSnow;
						trackWeatherName = "Snow";
						break;
					case 3:
						trackNumber[0] = 6;
						trackUsed = trackDirtWet;
						trackWeatherName = "Wet";
						break;
				}
				break;

			case 3:
				trackName = "Jungle";
				switch (trackWeather)
				{
					case 1:
						trackNumber[0] = 7;
						trackUsed = trackJungleDry;
						trackWeatherName = "Dry";
						break;
					case 2:
						trackNumber[0] = 8;
						trackUsed = trackJungleSnow;
						trackWeatherName = "Snow";
						break;
					case 3:
						trackNumber[0] = 9;
						trackUsed = trackJungleWet;
						trackWeatherName = "Wet";
						break;
				}
				break;
		}
					

	}
	
}