Added Alexandrs class
This commit is contained in:
parent
4eb70bd028
commit
86180f047c
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user