Updated 'LobbyAcceptMessage' class.
Updated the 'LobbyAcceptMessage' class by adding the 'host' attribute and its getter method to it.
This commit is contained in:
@@ -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.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user