You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Beet.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package garten.model;
  7. import java.util.ArrayList;
  8. /**
  9. *
  10. * @author Jan
  11. */
  12. public class Beet extends Gartenkomponente
  13. {
  14. int laenge;
  15. int breite;
  16. Pflanzengruppe pflgruppe;
  17. public Beet(int x, int y,int laenge, int breite)
  18. {
  19. positionx = x;
  20. positiony = y;
  21. this.laenge = laenge;
  22. this.breite = breite;
  23. pflgruppe = null;
  24. }
  25. public int [] getKoordinaten()
  26. {
  27. int[] temp = {positionx,positiony,laenge,breite};
  28. return temp;
  29. }
  30. public void setPflanzengruppeBeet(Pflanzengruppe pflgruppe)
  31. {
  32. this.pflgruppe = pflgruppe;
  33. }
  34. public ArrayList<Pflanze> getPflanzenausgruppe()
  35. {
  36. return pflgruppe.getPflanzeninGruppe();
  37. }
  38. public ArrayList<Pflanze> removePlfanzenGruppenBeet()
  39. {
  40. ArrayList<Pflanze> tempfl = new ArrayList<>();
  41. tempfl.addAll(pflgruppe.getPflanzeninGruppe());
  42. this.pflgruppe = null;
  43. return tempfl;
  44. }
  45. }