Class ClientConnected

All Implemented Interfaces:
Serializable

public class ClientConnected extends FixedStatusResponse
This Response is generated when a lobby's client connects and is sent to the lobby's clients. Therefore, it is FixedStatusResponse
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • lastConnectedNickname

      private final String lastConnectedNickname
    • players

      private final List<String> players
  • Constructor Details

    • ClientConnected

      public ClientConnected(String lastConnectedNickname, List<String> players)
      Create the response
      Parameters:
      lastConnectedNickname - the nickname of the player that just connected
      players - the list of all connected players
  • Method Details

    • getLastConnectedNickname

      public String getLastConnectedNickname()
      Get the user that generated this response by connecting
      Returns:
      the nickname of the user that just connected to the lobby
    • getPlayers

      public List<String> getPlayers()
      Get the players connected to the lobby
      Returns:
      an Unmodifiable List containing all players in the lobby