Package pacManReloaded.server

## Class Lobby

- java.lang.Object
- - pacManReloaded.server.Lobby

-     public class Lobby
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Lobby​(java.lang.String name, Server server)` | Constructor of the Lobby

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `addPlayer​(ServerThread thread)` | method to add a player to the lobby
    `java.lang.String` | `getName()` | getter for the name of the lobby
    `java.util.ArrayList<Player>` | `getPlayers()` | "getter" of the players
    `void` | `getServerTicks()` | messure of the server ticks in milli seconds, counts them to be able to analyse them
    `LobbyState` | `getState()` | "getter" for the state of the lobby
    `void` | `handleChangeDir​(java.lang.String changeDirMsg, ServerThread thread)` | handles the changing of each players moving direction
    `void` | `handleMessage​(IMessage gameMsg, ServerThread thread)` | handles messages of the game
    `boolean` | `hasPlayer​(java.lang.String playerName)` | method to check if the lobby contains player
    `void` | `removePlayer​(ServerThread thread)` | method to remove a player from the server
    `void` | `setState​(LobbyState state)` | "setter" for the state of the lobby

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Lobby

          public Lobby​(java.lang.String name,
                       Server server)

      Constructor of the Lobby
      Parameters:
        `name` - name of the lobby
        `server` - server the lobby is connected to

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      getter for the name of the lobby
      Returns:
        name of the lobby

    - #### getState

          public LobbyState getState()

      "getter" for the state of the lobby
      Returns:
        state of the lobby

    - #### setState

          public void setState​(LobbyState state)

      "setter" for the state of the lobby
      Parameters:
        `state` - lobby status

    - #### hasPlayer

          public boolean hasPlayer​(java.lang.String playerName)

      method to check if the lobby contains player
      Parameters:
        `playerName` - nickname of the player
      Returns:
        true if there are players in the lobby, else (if lobby is empty) false

    - #### addPlayer

          public boolean addPlayer​(ServerThread thread)

      method to add a player to the lobby
      Parameters:
        `thread` - thread of the server
      Returns:
        true if player was added (if players in lobby are less than 4), else (if there are or more players in a lobby) false

    - #### removePlayer

          public void removePlayer​(ServerThread thread)

      method to remove a player from the server
      Parameters:
        `thread` - thread of the server

    - #### handleMessage

          public void handleMessage​(IMessage gameMsg,
                                    ServerThread thread)

      handles messages of the game
      Parameters:
        `gameMsg` - message of the game
        `thread` - thread of the server

    - #### handleChangeDir

          public void handleChangeDir​(java.lang.String changeDirMsg,
                                      ServerThread thread)

      handles the changing of each players moving direction
      Parameters:
        `changeDirMsg` - message with the informations about the direction
        `thread` - the thread of the server

    - #### getPlayers

          public java.util.ArrayList<Player> getPlayers()

      "getter" of the players
      Returns:
        all players

    - #### getServerTicks

          public void getServerTicks()

      messure of the server ticks in milli seconds, counts them to be able to analyse them