mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
simplify VMatchUI.populate
This commit is contained in:
@@ -92,41 +92,27 @@ public enum VMatchUI implements IVTopLevelUI {
|
|||||||
// Add extra players alternatively to existing user/AI field panels.
|
// Add extra players alternatively to existing user/AI field panels.
|
||||||
for (int i = 2; i < lstFields.size(); i++) {
|
for (int i = 2; i < lstFields.size(); i++) {
|
||||||
// If already in layout, no need to add again.
|
// If already in layout, no need to add again.
|
||||||
if (lstFields.get(i).getParentCell() != null) {
|
VField vField = lstFields.get(i);
|
||||||
continue;
|
if (vField.getParentCell() == null) {
|
||||||
}
|
lstFields.get(i % 2).getParentCell().addDoc(vField);
|
||||||
|
|
||||||
if (i % 2 == 0) {
|
|
||||||
lstFields.get(0).getParentCell().addDoc(lstFields.get(i));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
lstFields.get(1).getParentCell().addDoc(lstFields.get(i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add extra players alternatively to existing user/AI field panels.
|
// Add extra players alternatively to existing user/AI field panels.
|
||||||
for (int i = 2; i < lstCommands.size(); i++) {
|
for (int i = 2; i < lstCommands.size(); i++) {
|
||||||
// If already in layout, no need to add again.
|
// If already in layout, no need to add again.
|
||||||
if (lstCommands.get(i).getParentCell() != null) {
|
VCommand cmdView = lstCommands.get(i);
|
||||||
continue;
|
if (cmdView.getParentCell() == null) {
|
||||||
}
|
lstCommands.get(i % 2).getParentCell().addDoc(cmdView);
|
||||||
|
|
||||||
if (i % 2 == 0) {
|
|
||||||
lstCommands.get(0).getParentCell().addDoc(lstCommands.get(i));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
lstCommands.get(1).getParentCell().addDoc(lstCommands.get(i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add extra hands to existing hand panel.
|
// Add extra hands to existing hand panel.
|
||||||
for (int i = 0; i < lstHands.size(); i++) {
|
for (int i = 0; i < lstHands.size(); i++) {
|
||||||
// If already in layout, no need to add again.
|
// If already in layout, no need to add again.
|
||||||
if (lstHands.get(i).getParentCell() != null) {
|
if (lstHands.get(i).getParentCell() == null) {
|
||||||
continue;
|
lstHands.get(0).getParentCell().addDoc(lstHands.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
lstHands.get(0).getParentCell().addDoc(lstHands.get(i));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill in gaps
|
// Fill in gaps
|
||||||
|
|||||||
Reference in New Issue
Block a user