Updated 'LobbyAcceptMessage' class.

Updated the 'LobbyAcceptMessage' class by adding the 'host' attribute and its getter method to it.
This commit is contained in:
Daniel Grigencha
2024-12-02 22:36:48 +01:00
parent 27f8af70f5
commit 492f7422f5

View File

@@ -7,13 +7,39 @@
*/ */
@Serializable @Serializable
public class LobbyAcceptMessage extends ServerMessage { public class LobbyAcceptMessage extends ServerMessage {
/**
* Create LobbyAcceptMessage attributes.
*/
private final int host;
/** /**
* Constructs a new LobbyAccept instance. * Constructs a new LobbyAccept instance.
*/ */
public LobbyAcceptMessage() { public LobbyAcceptMessage() {
super(); super();
this.host = -1;
} }
/**
* Constructor.
*
* @param host as the id of the host as an Integer.
*/
public LobbyAcceptMessage(int host) {
super();
this.host = host;
}
/**
* This method will be used return host attribute of LobbyAcceptMessage class.
*
* @return host as an Integer.
*/
public int getHost() {
return this.host;
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *