for (Component c : playersPanel.getComponents()) {
if (!(c instanceof CreateGamePlayerPanel))
continue;
CreateGamePlayerPanel playerPanel = (CreateGamePlayerPanel) c;
PlayerSlot ps = playerPanel.getSlot();
if (ps != null && ps.getSerial() != null) {
serials.add(ps.getSerial());
} else {
playerPanel.setSerialText("");
}
}
if (mutableSlots && !serials.isEmpty()) {
Collections.sort(serials);
boolean randomSeating = game.hasRule(
CustomRule.RANDOM_SEATING_ORDER);
for (Component c : playersPanel.getComponents()) {
if (!(c instanceof CreateGamePlayerPanel))
continue;
CreateGamePlayerPanel playerPanel = (CreateGamePlayerPanel) c;
PlayerSlot ps = playerPanel.getSlot();
if (ps != null && ps.getSerial() != null) {
String serial = randomSeating ? "?" : ("" + (1 + serials
.indexOf(ps.getSerial())));
playerPanel.setSerialText(serial);
}
}
}
}