package gui.simulator;

import gui.main.Main;

import java.awt.TexturePaint;
import java.awt.Window;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;

import javax.imageio.ImageIO;

public class Images{

	public static ArrayList<BufferedImage> images = new ArrayList<BufferedImage>();
	public static ArrayList<TexturePaint> tp = new ArrayList<TexturePaint>();

	static{
		try{
			images.add(ImageIO.read(Main.class.getResource("/sand.jpg"))); 
			images.add(ImageIO.read(Main.class.getResource("/grass.jpg")));
			images.add(ImageIO.read(Main.class.getResource("/street.jpg")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/ingang.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/toilet.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/tent.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/uitgang.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/snackbar.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/border.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/crosspoint.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/tree1.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/palmtree1.png")));
			images.add(ImageIO.read(Main.class.getResource("/simulator/fence.png")));
			images.add(ImageIO.read(Main.class.getResource("/visitor.png")));
			images.add(ImageIO.read(Main.class.getResource("/add.png")));
			images.add(ImageIO.read(Main.class.getResource("/ground_stone.jpg")));
			images.add(ImageIO.read(Main.class.getResource("/rotate.gif")));
			images.add(ImageIO.read(Main.class.getResource("/path.gif")));
			images.add(ImageIO.read(Main.class.getResource("/dirt.png")));
			images.add(ImageIO.read(Main.class.getResource("/stones.jpg")));
			images.add(ImageIO.read(Window.class.getResource("/topbar/play.png")));
			images.add(ImageIO.read(Window.class.getResource("/topbar/stop.png")));
			images.add(ImageIO.read(Window.class.getResource("/topbar/faster.png")));
			images.add(ImageIO.read(Window.class.getResource("/topbar/grid.png")));
			images.add(ImageIO.read(Window.class.getResource("/topbar/people.png")));
			images.add(ImageIO.read(Window.class.getResource("/topbar/pauze.png")));
			//images.add(ImageIO.read(Main.class.getResource("")));

			tp.add(new TexturePaint(Images.getImage(Images.ImageType.Sand), new Rectangle2D.Double(0, 0, 200, 200)));
			tp.add(new TexturePaint(Images.getImage(Images.ImageType.Grass), new Rectangle2D.Double(0, 0, 200, 200)));
			tp.add(new TexturePaint(Images.getImage(Images.ImageType.Street), new Rectangle2D.Double(0, 0, 200, 200)));

		}catch(IOException e){
			e.printStackTrace();
		}
	}

	public static BufferedImage getImage(ImageType img)
	{
		return images.get(img.ordinal());
	}

	public enum ImageType
	{
		Sand,
		Grass,
		Street,
		Entrance,
		Toilet,
		Tent,
		Exit,
		Snackbar,
		Border,
		Crosspoint,
		Tree1,
		PalmTree1,
		Fence,
		Visitor,
		Add,
		PathGroundStone,
		RotateCursor,
		PathCursor,
		PathDirt,
		PathStone,
		TopbarPlayButton,
		TopbarStopButton,
		TopbarFasterButton,
		TopbarGridButton,
		TopbarPeopleButton,
		TopbarPauzeButton,
		BeerBar
	}

	public enum TextPaint
	{
		TPSand,
		TPGrass,
		TPStreet
	}

	public static TexturePaint getTextPaint(TextPaint textp)
	{
		return tp.get(textp.ordinal());
	}

}
//enum ImageEnum
//{
//	Podium1("test.png"),
//	Podium2("test.png"),
//	Podium3("test.png"),
//	Podium4("test.png");
//
//	private BufferedImage image;
//	ImageEnum(String filename)
//	{
//		try {
//			this.image = ImageIO.read(Images.class.getResource(filename));
//
//
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//	}
//	public Image getImage() {
//		return image;
//	}



