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

@ -36,10 +36,15 @@ public class Beet extends Gartenkomponente
}
public ArrayList<Pflanze> getPflanzenausgruppe()
{
System.out.println("Beet frägt nach seinen Pflanzen");
System.out.println(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.beet(meinGarten.getBeet(koordinbeet));
konfig.erstellen();
//ArrayList<Pflanze> tempfl = meinGarten.getBeet(koordinbeet).removePlfanzenGruppenBeet();
//meinGarten.removePflanzen(tempfl);
for(Pflanze pf : meinGarten.getBeet(koordinbeet).getPflanzenausgruppe())
{
meinGarten.hinzufuegenPflanze(pf);

View File

@ -217,4 +217,11 @@ public class Garten extends Kompositum
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
*/
public class Kompositum
public class Kompositum extends Gartenkomponente
{
int flaeche;
public Kompositum()
{
flaeche = 0;
}
public int flaeche()
{
return flaeche();
}
}