Browse Source

refactoring: adjustingRemoveCardFromPlayerDeck

main
fdai7793 11 months ago
parent
commit
27d5587a57
  1. 13
      src/main/java/de/hsfulda/onses/services/PlayerService.java

13
src/main/java/de/hsfulda/onses/services/PlayerService.java

@ -53,20 +53,9 @@ public class PlayerService {
Player player; Player player;
if (this.currentTurn) { if (this.currentTurn) {
player = playerList.getFirst(); player = playerList.getFirst();
for (int i = 0; i < player.getPlayerDeck().size(); i++) {
if (player.getPlayerDeck().get(i) == card) {
player.getPlayerDeck().remove(i);
break;
}
}
} else { } else {
player = playerList.getLast(); 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);
} }
} }
Loading…
Cancel
Save