mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-03 18:14:18 +02:00
show all playe stats in toolbar
This commit is contained in:
@@ -3,6 +3,7 @@ package pp.monopoly.game.server;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
@@ -15,7 +16,7 @@ import pp.monopoly.model.LimitedLinkedList;
|
||||
*/
|
||||
@Serializable
|
||||
public class PlayerHandler {
|
||||
private List<Player> players = new LimitedLinkedList<>(6);
|
||||
private List<Player> players = new LinkedList<>();
|
||||
private Set<Player> readyPlayers = new HashSet<>();
|
||||
private transient ServerGameLogic logic;
|
||||
private Player hostPlayer;
|
||||
@@ -165,8 +166,10 @@ public class PlayerHandler {
|
||||
* @return the player with the required id
|
||||
*/
|
||||
public Player getPlayerById(int id) {
|
||||
System.out.println("TEST");
|
||||
for (Player player : players) {
|
||||
if (player.getId() == id) return player;
|
||||
System.out.println(player.getId());
|
||||
}
|
||||
throw new NoSuchElementException("Player mit id "+id+" existiert nicht");
|
||||
}
|
||||
|
Reference in New Issue
Block a user