mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
use Iterators instead of Lists where possible in manipulateCardList
This commit is contained in:
@@ -285,7 +285,7 @@ public class GuiChoose {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<CardView> manipulateCardList(final CMatchUI gui, final String title, final List<CardView> cards, final List<CardView> manipulable,
|
||||
public static List<CardView> manipulateCardList(final CMatchUI gui, final String title, final Iterable<CardView> cards, final Iterable<CardView> manipulable,
|
||||
final boolean toTop, final boolean toBottom, final boolean toAnywhere) {
|
||||
final Callable<List<CardView>> callable = new Callable<List<CardView>>() {
|
||||
@Override
|
||||
|
||||
@@ -1004,7 +1004,7 @@ public final class CMatchUI
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardView> manipulateCardList(final String title, final List<CardView> cards, final List<CardView> manipulable, final boolean toTop, final boolean toBottom, final boolean toAnywhere) {
|
||||
public List<CardView> manipulateCardList(final String title, final Iterable<CardView> cards, final Iterable<CardView> manipulable, final boolean toTop, final boolean toBottom, final boolean toAnywhere) {
|
||||
return GuiChoose.manipulateCardList(this, title, cards, manipulable, toTop, toBottom, toAnywhere);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,11 +59,12 @@ public class ListCardArea extends FloatingCardArea {
|
||||
setOpaque(false);
|
||||
}
|
||||
|
||||
public static ListCardArea show(final CMatchUI matchUI, final String title0, final List<CardView> cardList0, final List<CardView> moveableCards0, final boolean toTop0, final boolean toBottom0, final boolean toAnywhere0) {
|
||||
public static ListCardArea show(final CMatchUI matchUI, final String title0, final Iterable<CardView> cardList0, final Iterable<CardView> moveableCards0, final boolean toTop0, final boolean toBottom0, final boolean toAnywhere0) {
|
||||
if (storedArea==null) {
|
||||
storedArea = new ListCardArea(matchUI);
|
||||
}
|
||||
cardList = new ArrayList<CardView>(cardList0);
|
||||
cardList = new ArrayList<CardView>();
|
||||
for ( CardView cv : cardList0 ) { cardList.add(cv) ; }
|
||||
moveableCards = new ArrayList<CardView>(); // make sure moveable cards are in cardlist
|
||||
for ( CardView card : moveableCards0 ) {
|
||||
if ( cardList.contains(card) ) {
|
||||
|
||||
Reference in New Issue
Block a user