import java.awt.*;

/**
 * Beschreiben Sie hier die Klasse Figur.
 * 
 * @author Cellum
 * @version 1.0
 */
public abstract class Figur {
    // Instanzvariablen - ersetzen Sie das folgende Beispiel mit Ihren Variablen
    protected int x;
    protected int y;
    protected Color farbe;

    public Figur(int x , int y , Color farbe){
        this.x = x;
        this.y = y;
        this.farbe = farbe;
    }

    public void verschiebeUm(int dx, int dy){
        this.x = x + dx;
        this.y = y + dy;
    }

    public void verschiebeNach(int xNeu, int yNeu){
        this.x = xNeu;
        this.y = yNeu;
    }

    public void draw(Graphics g){
        g.setColor(farbe);
      }
    

    public abstract boolean enthaeltPunkt(int x, int y);
    public abstract double getFlaecheninhalt();
    public int compareTo(Figur f)
    {
        double delta = getFlaecheninhalt() - f.getFlaecheninhalt();
        if (delta < 0)
        {
            return -1;
        }
        if (delta > 0)
        {
            return 1;
        }
        return 0;
    }
    public void setColor(Color farbe) {
        this.farbe = farbe;
    }
}