fast fast fertig

This commit is contained in:
Apollo 2019-06-25 09:38:12 +02:00
parent 3909cc0e6e
commit 401897a492
4 changed files with 28 additions and 6 deletions

View File

@ -35,11 +35,16 @@ public class Beet extends Gartenkomponente
this.pflgruppe = pflgruppe; this.pflgruppe = pflgruppe;
} }
public ArrayList<Pflanze> getPflanzenausgruppe() public ArrayList<Pflanze> getPflanzenausgruppe()
{ {
System.out.println("Beet frägt nach seinen Pflanzen");
System.out.println(pflgruppe.getPflanzeninGruppe());
return pflgruppe.getPflanzeninGruppe(); return pflgruppe.getPflanzeninGruppe();
} }
public ArrayList<Pflanze> removePlfanzenGruppenBeet()
{
ArrayList<Pflanze> tempfl = new ArrayList<>();
tempfl.addAll(pflgruppe.getPflanzeninGruppe());
this.pflgruppe = null;
return tempfl;
}
} }

View File

@ -217,6 +217,10 @@ public class Gaertner implements MouseMotionListener, MouseListener,ActionListen
konfig.startlaenge(laenge); konfig.startlaenge(laenge);
konfig.beet(meinGarten.getBeet(koordinbeet)); konfig.beet(meinGarten.getBeet(koordinbeet));
konfig.erstellen(); konfig.erstellen();
//ArrayList<Pflanze> tempfl = meinGarten.getBeet(koordinbeet).removePlfanzenGruppenBeet();
//meinGarten.removePflanzen(tempfl);
for(Pflanze pf : meinGarten.getBeet(koordinbeet).getPflanzenausgruppe()) for(Pflanze pf : meinGarten.getBeet(koordinbeet).getPflanzenausgruppe())
{ {
meinGarten.hinzufuegenPflanze(pf); meinGarten.hinzufuegenPflanze(pf);

View File

@ -217,4 +217,11 @@ public class Garten extends Kompositum
zeichnePflanzen(); zeichnePflanzen();
} }
public void removePflanzen(ArrayList<Pflanze> pfl)
{
for(Pflanze p: pfl)
{
pflanzen.remove(p);
}
}
} }

View File

@ -10,10 +10,16 @@ package garten.model;
* *
* @author Jan * @author Jan
*/ */
public class Kompositum public class Kompositum extends Gartenkomponente
{ {
int flaeche;
public Kompositum() public Kompositum()
{ {
flaeche = 0;
}
public int flaeche()
{
return flaeche();
} }
} }