From 8650fa5b5818d83da7d615356caa3e4b3fbcdc1e Mon Sep 17 00:00:00 2001 From: Lukas Bauer <157071544+Heady045@users.noreply.github.com> Date: Sat, 5 Oct 2024 13:09:05 +0200 Subject: [PATCH] fix edited class EditorState fix edited battleship.properties with the right Key to fix an exception fix edited battleship_de.properties with the right Key to fix an exception --- .../src/main/java/pp/battleship/game/client/EditorState.java | 2 +- .../battleship/model/src/main/resources/battleship.properties | 3 ++- .../model/src/main/resources/battleship_de.properties | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Projekte/battleship/model/src/main/java/pp/battleship/game/client/EditorState.java b/Projekte/battleship/model/src/main/java/pp/battleship/game/client/EditorState.java index c555baca..0a00386e 100644 --- a/Projekte/battleship/model/src/main/java/pp/battleship/game/client/EditorState.java +++ b/Projekte/battleship/model/src/main/java/pp/battleship/game/client/EditorState.java @@ -238,7 +238,7 @@ public void loadMap(File file) throws IOException { if (!dto.fits(logic.getDetails())) throw new IOException(lookup("map.doesnt.fit")); if(!validMap(dto)){ - throw new IOException(lookup("map is invalid")); + throw new IOException(lookup("map.is.invalid")); } ownMap().clear(); dto.getShips().forEach(ownMap()::add); diff --git a/Projekte/battleship/model/src/main/resources/battleship.properties b/Projekte/battleship/model/src/main/resources/battleship.properties index c70480fc..6219bcf1 100644 --- a/Projekte/battleship/model/src/main/resources/battleship.properties +++ b/Projekte/battleship/model/src/main/resources/battleship.properties @@ -37,4 +37,5 @@ label.connecting=Connecting... dialog.error=Error dialog.question=Question port.must.be.integer=Port must be an integer number -map.doesnt.fit=The map doesn't fit to this game \ No newline at end of file +map.doesnt.fit=The map doesn't fit to this game +map.is.invalid=The Map is invalid \ No newline at end of file diff --git a/Projekte/battleship/model/src/main/resources/battleship_de.properties b/Projekte/battleship/model/src/main/resources/battleship_de.properties index 51732c83..9016e477 100644 --- a/Projekte/battleship/model/src/main/resources/battleship_de.properties +++ b/Projekte/battleship/model/src/main/resources/battleship_de.properties @@ -38,3 +38,4 @@ dialog.error=Fehler dialog.question=Frage port.must.be.integer=Der Port muss eine ganze Zahl sein map.doesnt.fit=Diese Karte passt nicht zu diesem Spiel +map.is.invalid=Diese Karte ist invalide \ No newline at end of file