use of mage.client.util.NaturalOrderCardNumberComparator in project mage by magefree.
the class MageBook method getCards.
private List<CardInfo> getCards(int page, String set) {
CardCriteria criteria = new CardCriteria();
criteria.setCodes(set);
List<CardInfo> cards = CardRepository.instance.findCards(criteria);
cards.sort(new NaturalOrderCardNumberComparator());
int start = page * conf.CARDS_PER_PAGE;
int end = page * conf.CARDS_PER_PAGE + conf.CARDS_PER_PAGE;
if (end > cards.size()) {
end = cards.size();
}
if (cards.size() > end) {
pageRight.setVisible(true);
}
return cards.subList(start, end);
}
use of mage.client.util.NaturalOrderCardNumberComparator in project mage by magefree.
the class MageBook method loadCards.
private List<Object> loadCards() {
CardCriteria criteria = new CardCriteria();
criteria.setCodes(currentSet);
List<CardInfo> cards = CardRepository.instance.findCards(criteria);
cards.sort(new NaturalOrderCardNumberComparator());
List<Object> res = new ArrayList<>();
cards.forEach(card -> res.add(new CardView(card.getMockCard())));
return res;
}
Aggregations