package ch.epfl.isochrone.gui;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JComponent;

import ch.epfl.isochrone.tiledmap.TileProvider;

public final class TiledMapComponent extends JComponent {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    private int zoom; 
    private List<TileProvider> listeFounisseur;
    
    public TiledMapComponent(int zoom)
    {
        super();
        
        if(zoom < 10 || zoom > 19){
            throw new IllegalArgumentException();
        }
        
        this.zoom = zoom; 
        listeFounisseur = new ArrayList<TileProvider>(); 
    }
    
    public int zoom(){
        return zoom;
    }
    
    public void addTileProvider(TileProvider tp)
    {
        listeFounisseur.add(tp);    
    }
    
    public Dimension getPrefferedSize()
    { 
        return new Dimension((int)Math.pow(2, zoom+8),(int)Math.pow(2, zoom+8));
    }
    
    public void paintComponent(Graphics g0)
    {
       Graphics2D g1 = (Graphics2D)g0; 
       
    }
    
    
    
    
}
