mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-29 04:19:44 +01:00
removed hostplayer as hostplayer always has id 0
This commit is contained in:
parent
f4c4f6bc93
commit
c71e8b1e8e
@ -19,7 +19,6 @@ public class PlayerHandler {
|
||||
private List<Player> players = new LinkedList<>();
|
||||
private Set<Player> readyPlayers = new HashSet<>();
|
||||
private transient ServerGameLogic logic;
|
||||
private Player hostPlayer;
|
||||
private Player extra = null;
|
||||
|
||||
/**
|
||||
@ -55,14 +54,6 @@ public class PlayerHandler {
|
||||
players.addAll(players);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the host player
|
||||
* @return the host player
|
||||
*/
|
||||
public Player getHostPlayer() {
|
||||
return hostPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of players
|
||||
* @return number of players in the game
|
||||
@ -114,9 +105,6 @@ public class PlayerHandler {
|
||||
throw new IllegalArgumentException("Player already registered");
|
||||
}
|
||||
players.add(player);
|
||||
if(hostPlayer == null) {
|
||||
hostPlayer = player;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -189,7 +189,7 @@ public class ServerGameLogic implements ClientInterpreter {
|
||||
@Override
|
||||
public void received(PlayerReady msg, int from) {
|
||||
Player player = playerHandler.getPlayerById(from);
|
||||
if(player == playerHandler.getHostPlayer()) {
|
||||
if(player.getId() == 0) {
|
||||
startMoney = msg.getStartMoney();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user