mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
refactor : removed all instances of new Random() and replaced with RandomUtil for a ThreadLocal randomizer
This commit is contained in:
parent
f2cc8d4571
commit
e2a479255a
51 changed files with 173 additions and 133 deletions
|
|
@ -14,6 +14,7 @@ import mage.cards.decks.Deck;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.interfaces.rate.RateCallback;
|
||||
import mage.util.RandomUtil;
|
||||
|
||||
/**
|
||||
* Builds deck from provided card pool.
|
||||
|
|
@ -205,7 +206,7 @@ public class DeckBuilder {
|
|||
ColoredManaSymbol bestColor = null;
|
||||
//Default to a color in the allowed colors
|
||||
if (allowedColors != null && !allowedColors.isEmpty()) {
|
||||
bestColor = allowedColors.get(new Random().nextInt(allowedColors.size()));
|
||||
bestColor = allowedColors.get(RandomUtil.nextInt(allowedColors.size()));
|
||||
}
|
||||
int lowestRatio = Integer.MAX_VALUE;
|
||||
for (final ColoredManaSymbol color : ColoredManaSymbol.values()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue