added an ArrayList of Player in game and added the received methods in clientgamelogic
This commit is contained in:
@@ -19,6 +19,7 @@ public class Game {
|
||||
private Board board;
|
||||
private Color activeColor;
|
||||
private List<Color> order;
|
||||
private final ArrayList<Player> playerList = new ArrayList<>(4);
|
||||
|
||||
private final ArrayList<Observer> observers = new ArrayList<>();
|
||||
private Player startPlayer;
|
||||
@@ -400,4 +401,16 @@ public Piece getPieceThroughIdentifier(String identifier) {
|
||||
int index = Integer.parseInt(parts[1]);
|
||||
return board.getPlayerData().get(color).getPieces()[index];
|
||||
}
|
||||
|
||||
public ArrayList<Player> getPlayerList() {
|
||||
return playerList;
|
||||
}
|
||||
|
||||
public void addPlayerToList(Player player) {
|
||||
playerList.add(player);
|
||||
}
|
||||
|
||||
public void removePlayerFromList(Player player) {
|
||||
playerList.remove(player);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user