package resources.image;

import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;

import javax.imageio.ImageIO;

import main.Main;

public class Images {

	private static ArrayList<BufferedImage> images = new ArrayList<BufferedImage>();

	public Images() {
	}

	// Load all images on start
	static {
		try {
			images.add(ImageIO.read(Main.class.getResource("/resources/image/player1_sprite.png")));
			images.add(ImageIO.read(Main.class.getResource("/resources/image/player2_sprite.png")));
			images.add(ImageIO.read(Main.class.getResource("/resources/image/background.png")));
			images.add(ImageIO.read(Main.class.getResource("/resources/image/background_menu.png")));
			images.add(ImageIO.read(Main.class.getResource("/resources/image/hearth.png")));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

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

	public static enum ImageType {
		PLAYER1, PLAYER2, BACKGROUND, BACKGROUND_MENU, HEARTH
	}
}
