Coverage Summary for Class: CreateLobbyRequest (it.polimi.ingsw.Server.Messages.Events.Requests)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| CreateLobbyRequest | 0% (0/1) | 0% (0/3) | 0% (0/5) |
1 package it.polimi.ingsw.Server.Messages.Events.Requests; 2 3 import java.io.Serial; 4 5 /** 6 * Represents a Client triying to create a new {@link it.polimi.ingsw.Server.Lobby} 7 */ 8 public class CreateLobbyRequest extends ClientRequest { 9 @Serial 10 private static final long serialVersionUID = 353L; 11 private final boolean isPublic; 12 private final int maxPlayers; 13 14 /** 15 * Construct the request 16 * 17 * @param isPublic true if the lobby is supposed to be publicly available on the Server 18 * @param maxPlayers the number of maximum players the lobby will allow (no bound is set but the server will impose it) 19 */ 20 public CreateLobbyRequest(boolean isPublic, int maxPlayers) { 21 this.isPublic = isPublic; 22 this.maxPlayers = maxPlayers; 23 } 24 25 /** 26 * Check if the lobby will be public 27 * 28 * @return true if the lobby will be public, false otherwise 29 */ 30 public boolean isPublic() { 31 return isPublic; 32 } 33 34 /** 35 * Get the maximum amount of players the lobby will have 36 * 37 * @return the maximum amount of players the lobby will have 38 */ 39 public int getMaxPlayers() { 40 return maxPlayers; 41 } 42 43 }