package gui.simulator;

import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;



public class Border extends DrawEngine implements Serializable {

	private static Images.ImageType images = Images.ImageType.Border;
	private static String facilityName = "Border";
	private int width;
	private int height;

    public  Border(int x, int y, int width, int heigth, Terrain terrain) {
        super(images, x, y, 1, 0, SimulatorPane.Objects.BORDER, terrain, null, false);
    }
    
    public String getFacilityName(){
    	return facilityName;
    }
    
    @Override
    public boolean contains(Point2D point){
        Shape shape = new Rectangle2D.Double(0, 0, getWidth(), getHeight());
        return this.getAffineTransform().createTransformedShape(shape).contains(point);
    }
    
    @Override
    public void draw(Graphics2D g){
        g.drawRect((int)getX(), (int)getY(), getHeight(),getWidth());
    }
    @Override
    public void setRotation(double rotation) {
    }
    @Override
    public double getScale() {
    return 0.0;
    }
    @Override
    public void setScale(double scale) {
    
    }
    @Override
    public int getWidth(){
    	return width;
    }
    @Override
    public int getHeight(){
    	return height;
    }
    @Override
    public double getRotation() {
    	return 0.0;
    }

}