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

public class Quadrat extends Figur{
  
  protected int a;
  
  public Quadrat(int x ,int y, int a, Color color){
          super(x,y,color);
          this.a =a;
          }

  public void draw (Graphics g) {
      super.draw(g);
      g.fillRect(x - a / 2, y - a / 2, a, a);
  }

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