Skip to content
Snippets Groups Projects
Commit 774c8083 authored by joonatan's avatar joonatan
Browse files

ottelun poisto toimiii

parent a3a14c5e
No related branches found
No related tags found
No related merge requests found
1|2|6|4|3|2|6|1996-05-13|6-4, 6-4 1|2|6|4|3|2|6|1996-05-13|6-4, 6-4
0|3|1|5|2|5|2|2024-04-09|6-0 2|4|6|2|3|4|6|2024-01-08|5-7, 5-7
2|2|3|4|5|4|5|2024-04-01|6-0, 6-2 3|2|3|4|5|4|5|2024-04-01|6-0, 6-2
3|1|2|6|4|1|2|2024-04-08|6-4, 7-5 4|1|2|6|4|1|2|2024-04-08|6-4, 7-5
4|2|6|4|3|2|6|2024-02-12|6-2, 4-6, 6-0 5|2|6|4|3|2|6|2024-02-12|6-2, 4-6, 6-0
5|4|6|2|3|4|6|2024-01-08|5-7, 5-7 6|4|6|2|3|4|6|2024-01-08|5-7, 5-7
0|2|3|7|9|2|3|2024-02-26|6-0, 6-4 7|2|6|4|3|2|6|1996-05-13|6-4, 6-4
7|2|4|1|3|1|3|2024-04-05|6-4 8|2|3|4|5|4|5|2024-04-01|6-0, 6-2
8|2|5|8|9|2|5|2024-03-04|6-3, 6-2 9|1|2|6|4|1|2|2024-04-08|6-4, 7-5
9|2|6|4|3|2|6|1996-05-13|6-4, 6-4 10|2|6|4|3|2|6|2024-02-12|6-2, 4-6, 6-0
12|2|6|4|3|2|6|1996-05-13|6-4, 6-4
14|1|2|6|4|1|2|2024-04-08|6-4, 7-5
15|2|6|4|3|2|6|2024-02-12|6-2, 4-6, 6-0
...@@ -161,4 +161,9 @@ public class Karkelot { ...@@ -161,4 +161,9 @@ public class Karkelot {
System.out.println(ex.getMessage()); System.out.println(ex.getMessage());
} }
} }
public void poistaOttelu(Ottelu ott) {
ottelut.poistaOttelu(ott);
}
} }
...@@ -131,6 +131,11 @@ public class Ottelut implements Iterable<Ottelu> { ...@@ -131,6 +131,11 @@ public class Ottelut implements Iterable<Ottelu> {
} }
} }
public void poistaOttelu(Ottelu ott) {
alkiot.remove(ott);
}
/* /*
public void lueTiedostosta(String tiedosto) { public void lueTiedostosta(String tiedosto) {
......
...@@ -65,18 +65,16 @@ public class PadelLisaaOtteluGUIController implements ModalControllerInterface<S ...@@ -65,18 +65,16 @@ public class PadelLisaaOtteluGUIController implements ModalControllerInterface<S
@FXML void handlePoista() { @FXML void handlePoista() {
if(muok>0) { if(muok>0) {
Ottelu ott = PadelMainGUIController.getKarkelo().noudaOttelu(muok); Ottelu ott = PadelMainGUIController.getKarkelo().noudaOttelu(muok);
ott.setTunnusNro(0); PadelMainGUIController.getKarkelo().poistaOttelu(ott);
int i = muok;
while(i<PadelMainGUIController.getKarkelo().noudaOttelut().size()-1) { // Suljetaan ikkuna
Ottelu otte = PadelMainGUIController.getKarkelo().noudaOttelu(i+1); Stage stage = (Stage) OKButton.getScene().getWindow();
otte.setTunnusNro(i+1); stage.close();
i++;
}
} }
OtteluIkkunaGUIController.muokattava=-1;
} }
//======================================================= //=======================================================
...@@ -111,7 +109,7 @@ public class PadelLisaaOtteluGUIController implements ModalControllerInterface<S ...@@ -111,7 +109,7 @@ public class PadelLisaaOtteluGUIController implements ModalControllerInterface<S
Ottelu ott = PadelMainGUIController.getKarkelo().noudaOttelu(muok); Ottelu ott = PadelMainGUIController.getKarkelo().noudaOttelu(muok);
int numerot[] = ott.getPelaajaNrot(); int numerot[] = ott.getPelaajaNrot();
System.out.println(numerot[0] +" "+ numerot[1]+" "+ numerot[2]+" "+numerot[3]+""); System.out.println(numerot[0] +" "+ numerot[1]+" "+ numerot[2]+" "+numerot[3]+" " + muok);
menuOsallistuja1.setSelectedIndex(numerot[0]-1); menuOsallistuja1.setSelectedIndex(numerot[0]-1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment