From 27d5587a57e63ee29ac2e88db08656bfa23eb6fd Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Sat, 3 Feb 2024 17:54:54 +0100 Subject: [PATCH] refactoring: adjustingRemoveCardFromPlayerDeck --- .../de/hsfulda/onses/services/PlayerService.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/services/PlayerService.java b/src/main/java/de/hsfulda/onses/services/PlayerService.java index 1d74ef9..3c3fb47 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -53,20 +53,9 @@ public class PlayerService { Player player; if (this.currentTurn) { player = playerList.getFirst(); - for (int i = 0; i < player.getPlayerDeck().size(); i++) { - if (player.getPlayerDeck().get(i) == card) { - player.getPlayerDeck().remove(i); - break; - } - } } else { player = playerList.getLast(); - for (int i = 0; i < player.getPlayerDeck().size(); i++) { - if (player.getPlayerDeck().get(i) == card) { - player.getPlayerDeck().remove(i); - break; - } - } } + player.getPlayerDeck().remove(card); } }