import sum.kern.*;

public class Lokomotive extends Waggon
{
    public Lokomotive(int pH, int pV)
    {
        super (pH, pV);
        this.setzeLaenge(90);
    }

    // Dienste
    protected void zeichne()
    {
        double lH, lV;
        
        lH = this.hatStift.hPosition();
        lV = this.hatStift.vPosition();
        
		// Puffer links
		this.hatStift.runter();
		this.hatStift.dreheBis(90); //oben
		this.hatStift.bewegeUm(3);
		this.hatStift.dreheUm(180); //unten
		this.hatStift.bewegeUm(6);
		this.hatStift.dreheUm(180); //oben
		this.hatStift.bewegeUm(3);
		this.hatStift.dreheUm(270); //rechts
		this.hatStift.bewegeUm(5);
		
		// Vorderteil
		this.hatStift.hoch();
		this.hatStift.dreheUm(90); //oben
		this.hatStift.bewegeUm(20);
		this.hatStift.zeichneRechteck(50,25);
		
		// Schornstein
		this.hatStift.bewegeUm(15);
		this.hatStift.dreheUm(-90); //rechts
		this.hatStift.bewegeUm(10);
		this.hatStift.zeichneRechteck(5,15);
		
		// Fuehrerhaus
		this.hatStift.bewegeUm(40);
		this.hatStift.dreheUm(90); //oben
		this.hatStift.bewegeUm(10);
		this.hatStift.zeichneRechteck(30,50);

		// Fenster
		this.hatStift.bewegeUm(-5);
		this.hatStift.dreheUm(-90); //rechts
		this.hatStift.bewegeUm(5);
		this.hatStift.zeichneRechteck(20,20);
		
		// Raeder
		this.hatStift.dreheUm(-90); //unten
		this.hatStift.bewegeUm(50);
		this.hatStift.dreheUm(90); //rechts
		this.hatStift.bewegeUm(15);
		this.hatStift.zeichneKreis(5);
		this.hatStift.bewegeUm(-60);
		this.hatStift.zeichneKreis(5);
		
		// Puffer rechts
		this.hatStift.bewegeUm(70);
		this.hatStift.dreheUm(90); //oben
		this.hatStift.bewegeUm(10);
		this.hatStift.runter();
		this.hatStift.dreheUm(270); //rechts
		this.hatStift.bewegeUm(5);
		this.hatStift.dreheUm(90); //oben
		this.hatStift.bewegeUm(3);
		this.hatStift.dreheUm(180); //unten
		this.hatStift.bewegeUm(6);
		this.hatStift.dreheUm(180); //oben
		this.hatStift.bewegeUm(3);
		
		// zurueck zur Ausgangsposition
		this.hatStift.hoch();
		this.hatStift.bewegeBis(lH, lV);
		hatStift.dreheBis(0);
    }

}

