Skip to content

Commit

Permalink
random deck are now for stable decksniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Sep 22, 2023
1 parent cb6403f commit a580b0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TappedOutDeckSniffer extends AbstractDeckSniffer {

@Override
public STATUT getStatut() {
return STATUT.BETA;
return STATUT.DEPRECATED;
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/magic/services/MTGDeckManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.magic.api.beans.technical.RetrievableDeck;
import org.magic.api.interfaces.MTGDao;
import org.magic.api.interfaces.MTGDeckSniffer;
import org.magic.api.interfaces.MTGPlugin.STATUT;
import org.magic.services.logging.MTGLogger;
import org.magic.services.tools.MTG;
import org.utils.patterns.observer.Observable;
Expand Down Expand Up @@ -235,7 +236,7 @@ public MagicDeck generateRandomDeck() throws IOException
try {
Random random= SecureRandom.getInstanceStrong();

List<MTGDeckSniffer> deckServices = listEnabledPlugins(MTGDeckSniffer.class);
List<MTGDeckSniffer> deckServices = listEnabledPlugins(MTGDeckSniffer.class).stream().filter(p->p.getStatut()==STATUT.STABLE).toList();
MTGDeckSniffer sniffer = deckServices.get(random.nextInt(deckServices.size()));
String[] formats = sniffer.listFilter();
List<RetrievableDeck> availableDecks = sniffer.getDeckList(formats[random.nextInt(formats.length)]);
Expand Down

0 comments on commit a580b0b

Please sign in to comment.