import stiftUndCo.*;
import figures.*;
import java.awt.*;
import figures.*;

public class Wand extends Rechteck{

private Bildschirm b;
private double v,yk1,yk2;

public Wand(double x1, double y1, double x2, double y2, double verschiebeVariable, Bildschirm bildschirm, Color c){

	super(x1,y1,x2,y2);
        
	b = bildschirm;
	v = verschiebeVariable;
	yk1 = y1;
	yk2 = y2;
        setzeFuellFarbe(c);
}

	public void Hoch(){
		if(yk1 > 0){
			verschiebe(0,-v);
			yk1=yk1-v;
			yk2=yk2-v;
		}

	}

	public void Runter(){
		if(yk2 < b.hoehe()){
			verschiebe(0,v);
			yk1=yk1+v;
			yk2=yk2+v;
		}
	}

	public double getY1(){
		return(yk1);
	}

	public double getY2(){
		return(yk2);
	}
}
