Browse Source

fast fast fertig

master
Apollo 4 years ago
parent
commit
401897a492

+ 9
- 4
Garten/src/garten/model/Beet.java View File

@@ -35,11 +35,16 @@ public class Beet extends Gartenkomponente
this.pflgruppe = pflgruppe;
}
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;
}

}

+ 4
- 0
Garten/src/garten/model/Gaertner.java 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);

+ 7
- 0
Garten/src/garten/model/Garten.java 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);
}
}
}

+ 8
- 2
Garten/src/garten/model/Kompositum.java 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();
}
}

Loading…
Cancel
Save