package ch.epfl.isochrone.tiledmap;

import java.awt.image.BufferedImage;

public final class Tile {
    
    private int x;
    private int y; 
    private int zoom; 
    private BufferedImage image; 
    
    public Tile(int x, int y, int zoom,BufferedImage image){
        this.x = x; 
        this.y = y; 
        this.zoom = zoom; 
        this.image = image; 
    }
    
    public int hashCode() {
        return x+y+zoom;
    }
    
    public boolean equals(Object that) {
        if (that.getClass() == this.getClass()) {
            if (((ch.epfl.isochrone.tiledmap.Tile) that).x == this.x
                    && ((ch.epfl.isochrone.tiledmap.Tile) that).y == this
                            .y
                    && ((ch.epfl.isochrone.tiledmap.Tile) that).zoom == this
                            .zoom) {
                return true;
            }
        }
        return false;
    }
    
    public int x()
    {
        return x;
    }
    
    public int y()
    {
        return y;
    }
    
    public int zoom()
    {
        return zoom;
    }
    
    public BufferedImage image()
    {
        return image;
    }
}
