From 0a7ca1ac3e107f223c41c6962f6d90daaa4cc93e Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 13 May 2022 15:36:29 +0200 Subject: [PATCH] fixed places are deleted. solved #45 --- .../java/ch/zhaw/projekt2/turnierverwaltung/Game.java | 8 -------- .../main/gameScheduleView/GameController.java | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Game.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Game.java index 51bbded..594d1b2 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Game.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Game.java @@ -19,14 +19,6 @@ public class Game implements Serializable { this.previousGame2 = previousGame2; } - public Place getLocation() { - return place; - } - - public void setLocation(Place place) { - this.place = place; - } - public int getPoints1() { return points1; } diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameController.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameController.java index c8f5761..07f4de1 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameController.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameController.java @@ -74,7 +74,7 @@ public class GameController extends FXController{ public void setup(TournamentDecorator tournamentDecorator, FileIO fileIO, FactoryDecorator factoryDecorator, Pane pane, GameDecorator gameDecorator) { setTournamentDecorator(tournamentDecorator); this.gameDecorator = gameDecorator; - placesChoiceBox.getSelectionModel().selectedItemProperty().addListener((ObservableValue observable, Place oldValue, Place newValue) -> saveGamePlace(newValue)); + placesChoiceBox.getSelectionModel().selectedItemProperty().addListener((ObservableValue observable, Place oldValue, Place newValue) -> saveGamePlace(newValue == null ? oldValue : newValue)); } } \ No newline at end of file