/**
   * Constructor will initialize the object.
   *
   * @param server the server which is responsible to handle the given client.
   * @param client Instance of {@link ProMaSiClient}
   * @param clientId The client id.
   * @throws NetworkException in case of invalid arguments or initialization errors.
   */
  public ChooseGameClientState(ProMaSiServer server, ProMaSiClient client, String clientId)
      throws NetworkException {
    if (server == null) {
      _logger.error("Initialization failed because a wrong argument server == null");
      throw new NetworkException("Wrong argument server==null");
    }

    if (clientId == null) {
      _logger.error("Initialization failed because a wrong argument clientId == null");
      throw new NetworkException("Wrong argument clientId==null");
    }

    if (client == null) {
      _logger.error("Initialization failed because a wrong argument client == null");
      throw new NetworkException("Wrong argument client==null");
    }

    _clientId = clientId;
    _server = server;
    _client = client;
    _client.addListener(this);
    _logger.debug("Initialization complete");
  }
 @Override
 public void onConnectionError(ProMaSiClient client) {
   _client.removeListener(this);
   _logger.debug("Client connection error");
 }
 @Override
 public void onDisconnect(ProMaSiClient client) {
   _client.removeListener(this);
   _logger.debug("Client disconnected");
 }