refactoring

This commit is contained in:
2022-01-13 19:23:52 +01:00
parent 8b2a2c400f
commit b1455b5f5a
8 changed files with 130 additions and 84 deletions

View File

@@ -34,5 +34,16 @@ public final class SessionJoinedMessage extends ServerMessage implements Respons
this.player = player;
this.players = List.copyOf(players);
this.secret = secret;
boolean found = false;
for (var playerData : players) {
if (playerData.getUuid().equals(player)) {
found = true;
break;
}
}
if (!found) {
throw new IllegalArgumentException("Player not contained in players.");
}
}
}