public bool Equals(ClientData p) { if (p == null) { return(false); } return((getUsername() == p.getUsername()) && (getAddress() == p.getAddress()) && (getPort() == p.getPort()) && (isAlive() == p.isAlive()) && (isWerewolf() == p.isWerewolf()) && (getEndPoint() == p.getEndPoint())); }
private bool addClient(ClientData client) { bool werewolf = new Random().NextDouble() < 0.3; foreach (ClientData ecl in clients) { if (ecl.getUsername().Equals(client.getUsername())) { return(false); } } isClientReady.Add(false); clients.Add(client); if (werewolf) { client.setRole(true); wolves.Add(client); } return(true); }