|
@ -7,7 +7,7 @@ import java.util.ArrayList; |
|
|
public class PlayerService { |
|
|
public class PlayerService { |
|
|
|
|
|
|
|
|
private boolean currentTurn = true; // true --> real player, false --> Bot |
|
|
private boolean currentTurn = true; // true --> real player, false --> Bot |
|
|
private int totalTurns = 0; |
|
|
|
|
|
|
|
|
|
|
|
private final ArrayList<Player> playerList = new ArrayList<>(); |
|
|
private final ArrayList<Player> playerList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
public ArrayList<Player> getPlayerList() { |
|
|
public ArrayList<Player> getPlayerList() { |
|
@ -15,17 +15,13 @@ public class PlayerService { |
|
|
} |
|
|
} |
|
|
public void addPlayerToList(Player player) { |
|
|
public void addPlayerToList(Player player) { |
|
|
playerList.add(player); |
|
|
playerList.add(player); |
|
|
totalTurns++; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void nextTurn() |
|
|
public void nextTurn() |
|
|
{ |
|
|
{ |
|
|
currentTurn = !currentTurn; |
|
|
currentTurn = !currentTurn; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean getCurrentTurn() { |
|
|
public boolean getCurrentTurn() { |
|
|
return currentTurn; |
|
|
return currentTurn; |
|
|
} |
|
|
} |
|
@ -35,12 +31,4 @@ public class PlayerService { |
|
|
return this; |
|
|
return this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public int getTotalTurns() { |
|
|
|
|
|
return totalTurns; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public PlayerService setTotalTurns(int totalTurns) { |
|
|
|
|
|
this.totalTurns = totalTurns; |
|
|
|
|
|
return this; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |