// WARNING: This file is auto-generated and any changes to it will be overwritten import lang.stride.*; import java.util.*; import greenfoot.*; /** * Die Uebungen (mit Loesungen) zu diesem Szenario finden Sie hier: * http://www.informatikzentrale.de/uebungen-foreach-schleife-greenfoot-3.html */ public class Schaltpult extends World { protected int ausgabeX = 270; protected int ausgabeY = 140; private Heizung[] heizungen = new Heizung[6]; private Konto[] kontoliste = new Konto[4]; private Heizung h1 = new Heizung(80, "Wohnzimmer"); private Heizung h2 = new Heizung(72, "Küche"); private Heizung h3 = new Heizung(76, "Bad"); private Heizung h4 = new Heizung(20, "Keller"); private Heizung h5 = new Heizung(2, "Garage"); private Heizung h6 = new Heizung(53, "Schlafzimmer"); private Konto sparkonto = new Konto(73271372, 12432.31, "Rocky Balboa"); private Konto girokonto = new Konto(4873912, -3201.96, "Rocky Balboa"); private Konto aktiendepot = new Konto(93821, 42312.11, "Samantha Balboa"); private Konto tagesgeldkonto = new Konto(73271373, 98.46, "Rocky Balboa"); /** * Constructor for objects of class MyWorld. */ public Schaltpult() { super(900, 554, 1); this.addObject( new KnopfHeizung(), 90, 480); this.addObject( new KnopfHeizungTemperaturNull(), 240, 480); this.addObject( new KnopfLottozahlenAusgeben(), 820, 490); this.addObject( new KnopfKonten(), 450, 480); this.addObject( new KnopfCheckKonto(), 58, 83); this.addObject( new KnopfCheckHeizung(), 58, 184); this.addObject( new KnopfTest1(), 820, 83); this.addObject( new KnopfTest2(), 820, 200); this.heizungen[0] = h1; this.heizungen[1] = h2; this.heizungen[2] = h3; this.heizungen[3] = h4; this.heizungen[4] = h5; this.heizungen[5] = h6; this.kontoliste[0] = sparkonto; this.kontoliste[1] = girokonto; this.kontoliste[2] = aktiendepot; this.kontoliste[3] = tagesgeldkonto; } /** * */ public void textAusgeben(String text) { this.showText(text, this.ausgabeX, this.ausgabeY); this.ausgabeY = this.ausgabeY + 20; } /** * */ public void allenTextLoeschen() { for (final int x : lang.stride.Utility.makeRange(1, this.getWidth())) { for (final int y : lang.stride.Utility.makeRange(0, this.getHeight())) { this.showText("", x, y); } } } /** * */ public Heizung[] getHeizungen() { return this.heizungen; } /** * */ public Konto[] getKontoliste() { return this.kontoliste; } /** * */ public void act() { } }