From 6be9ba627edbd1f7f0cc3c929663d2b89f67815a Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Fri, 2 Feb 2024 11:33:12 +0100 Subject: [PATCH] refactoring: remove useless totalTurns 2PlayerChange --- .../de/hsfulda/onses/services/PlayerService.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/services/PlayerService.java b/src/main/java/de/hsfulda/onses/services/PlayerService.java index ff9f869..d726af8 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -7,7 +7,7 @@ import java.util.ArrayList; public class PlayerService { private boolean currentTurn = true; // true --> real player, false --> Bot - private int totalTurns = 0; + private final ArrayList playerList = new ArrayList<>(); public ArrayList getPlayerList() { @@ -15,17 +15,13 @@ public class PlayerService { } public void addPlayerToList(Player player) { playerList.add(player); - totalTurns++; } - public void nextTurn() { currentTurn = !currentTurn; } - - public boolean getCurrentTurn() { return currentTurn; } @@ -35,12 +31,4 @@ public class PlayerService { return this; } - public int getTotalTurns() { - return totalTurns; - } - - public PlayerService setTotalTurns(int totalTurns) { - this.totalTurns = totalTurns; - return this; - } }