mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Updated API call to CardDB with PreferredCardArt
Note: the `convertByXitaxMethod` will be soon discontinued thanks to the new upcoming option and API. Same will apply to those methods in StaticData
This commit is contained in:
@@ -17,25 +17,16 @@
|
||||
*/
|
||||
package forge.deck;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.StaticData;
|
||||
import forge.card.CardDb;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.item.PaperCard;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Deck class.
|
||||
@@ -261,7 +252,7 @@ public class Deck extends DeckBase implements Iterable<Entry<DeckSection, CardPo
|
||||
|
||||
private void convertByXitaxMethod() {
|
||||
Date dateWithAllCards = StaticData.instance().getEditions().getEarliestDateWithAllCards(getAllCardsInASinglePool());
|
||||
String artOption = StaticData.instance().getPrefferedArtOption();
|
||||
String artOption = StaticData.instance().getPreferredCardArt();
|
||||
|
||||
for(Entry<DeckSection, CardPool> p : parts.entrySet()) {
|
||||
if( p.getKey() == DeckSection.Planes || p.getKey() == DeckSection.Schemes || p.getKey() == DeckSection.Avatar)
|
||||
@@ -285,6 +276,9 @@ public class Deck extends DeckBase implements Iterable<Entry<DeckSection, CardPo
|
||||
replacementCard = StaticData.instance().getCardByEditionDate(card, dateWithAllCards);
|
||||
}
|
||||
|
||||
// Note @leriomaggio: The following logic is very obscure to me
|
||||
// Why looking for a replacement Card and then not using adding it to the pool?
|
||||
// Also, what does "having the same art index" say about the two cards?
|
||||
if (replacementCard.getArtIndex() == card.getArtIndex()) {
|
||||
if (card.hasImage())
|
||||
newPool.add(card, count);
|
||||
|
||||
Reference in New Issue
Block a user