diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerJoinedMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerJoinedMessage.java index cf1be4e6..fdc5ede4 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerJoinedMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerJoinedMessage.java @@ -19,16 +19,23 @@ public class LobbyPlayerJoinedMessage extends ServerMessage { */ private final int id; + /** + * The flag is the new player is the host + */ + private final boolean host; + /** * Constructs a new LobbyPlayerJoin instance with the specified player name. * * @param player the player joining the lobby - * @param id the id of the player + * @param id the id of the player + * @param host as the flag if the player is the host as a Boolean. */ - public LobbyPlayerJoinedMessage(int id, Player player) { + public LobbyPlayerJoinedMessage(int id, Player player, boolean host) { super(); this.player = player; this.id = id; + this.host = host; } /** @@ -37,6 +44,7 @@ public LobbyPlayerJoinedMessage(int id, Player player) { private LobbyPlayerJoinedMessage() { player = null; id = 0; + host = false; } /** @@ -57,6 +65,10 @@ public int getId(){ return id; } + public boolean isHost() { + return this.host; + } + /** * Accepts a visitor to process this message. *