Merge remote-tracking branch 'magefree/master'

This commit is contained in:
Samuel Sandeen 2016-09-07 23:31:38 -04:00
commit 80da09471d
139 changed files with 5092 additions and 252 deletions

View file

@ -45,6 +45,7 @@ import mage.cards.Card;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.util.RandomUtil;
/**
*
@ -52,7 +53,6 @@ import mage.game.Game;
*/
public class Library implements Serializable {
private static Random rnd = new Random();
private boolean emptyDraw;
private final Deque<UUID> library = new ArrayDeque<>();
@ -76,7 +76,7 @@ public class Library implements Serializable {
public void shuffle() {
UUID[] shuffled = library.toArray(new UUID[0]);
for (int n = shuffled.length - 1; n > 0; n--) {
int r = rnd.nextInt(n);
int r = RandomUtil.nextInt(n);
UUID temp = shuffled[n];
shuffled[n] = shuffled[r];
shuffled[r] = temp;

View file

@ -78,7 +78,6 @@ import mage.target.TargetAmount;
import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
import mage.util.Copyable;
import mage.util.MessageToClient;
/**
*
@ -486,7 +485,7 @@ public interface Player extends MageItem, Copyable<Player> {
boolean chooseUse(Outcome outcome, String message, Ability source, Game game);
boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game);
boolean chooseUse(Outcome outcome, String message, String secondMessage, String trueText, String falseText, Ability source, Game game);
boolean choose(Outcome outcome, Choice choice, Game game);

View file

@ -132,13 +132,13 @@ import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetDiscard;
import mage.util.CardUtil;
import mage.util.GameLog;
import mage.util.RandomUtil;
import org.apache.log4j.Logger;
public abstract class PlayerImpl implements Player, Serializable {
private static final Logger logger = Logger.getLogger(PlayerImpl.class);
private static Random rnd = new Random();
private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS");
/**
@ -2326,7 +2326,7 @@ public abstract class PlayerImpl implements Player, Serializable {
*/
@Override
public boolean flipCoin(Game game, ArrayList<UUID> appliedEffects) {
boolean result = rnd.nextBoolean();
boolean result = RandomUtil.nextBoolean();
if (!game.isSimulation()) {
game.informPlayers("[Flip a coin] " + getLogName() + (result ? " won (head)." : " lost (tail)."));
}