Added Alexandrs class

This commit is contained in:
Seraina 2022-03-27 14:30:54 +02:00
parent 4eb70bd028
commit 86180f047c

View File

@ -0,0 +1,14 @@
package ch.unibas.dmi.dbis.cs108.multiplayer.server;
/* This class is built to contain the usernames of all players in a single string.
* This allows a duplicate check (--> ClientHandler) when a new player chooses
* a name: does the string with all the previous names contain the new player's
* desired username? If yes, he is being assigned a random name. If no, he can keep
* his desired name. */
public class AllClientNames {
static StringBuilder names = new StringBuilder();
public static String allNames(String currentName) {
return names.append(currentName).toString();
}
}