merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
Showing only changes of commit de5c8bf44c - Show all commits

View File

@@ -152,6 +152,15 @@ public Player getPlayerByColor(Color color) {
return null; return null;
} }
/**
* This method will be used to return all connected players as a list.
*
* @return players as a List of Player objects.
*/
public List<Player> getPlayersAsList() {
return new ArrayList<>(this.players.values());
}
/** /**
* This method will be used to return the id of the active player depending on the activeColor attribute of Game * This method will be used to return the id of the active player depending on the activeColor attribute of Game
* class. * class.
@@ -216,8 +225,8 @@ public boolean areAllReady() {
* @return the piece specified by the UUID * @return the piece specified by the UUID
*/ */
public Piece getPieceThroughUUID(UUID pieceId) { public Piece getPieceThroughUUID(UUID pieceId) {
for (var playerData : board.getPlayerData().values()) { for (var player : this.getPlayers().values()) {
for (var piece : playerData.getPieces()) { for (var piece : player.getPieces()) {
if (piece.getUuid().equals(pieceId)) { if (piece.getUuid().equals(pieceId)) {
return piece; return piece;
} }