import java.awt.*;
/**
 *
 * Beschreibung
 *
 * @version 1.0
 * @author Cellum
 */

public class Quadrat extends Figur{
  //Attribute der Klasse Quadrat
  
  public int groesse;  
    
  //Konstruktor
  public Quadrat(int x, int y, int groesse, Color farbe){
    super(x,y,farbe);
    this.groesse = groesse;
  }

  public void draw (Graphics g){
    super.draw(g);
    g.fillRect(x-groesse/2,y-groesse/2,groesse,groesse);
  }  //end of class Quadrat


  @Override
  public boolean enthaeltPunkt(int x, int y) {
    if(x <= this.x + groesse / 2 && x >= this.x - groesse / 2 && y <= this.y + groesse / 2 && y >= this.y - groesse / 2 ){
       return true; 
    }
      return false;
    }

  
  public double getFlaecheninhalt() {
    return 0;
  }
}