added optimization for simulations - don't construct Strings for messages that will never be used

This commit is contained in:
betasteward 2015-03-31 09:44:22 -04:00
parent 9f834bc6f7
commit a878d4879b
67 changed files with 313 additions and 205 deletions

View file

@ -207,7 +207,8 @@ public class Spell implements StackObject, Card {
return result;
}
//20091005 - 608.2b
game.informPlayers(getName() + " has been fizzled.");
if (!game.isSimulation())
game.informPlayers(getName() + " has been fizzled.");
counter(null, game);
return false;
} else if (this.getCardType().contains(CardType.ENCHANTMENT) && this.getSubtype().contains("Aura")) {
@ -248,7 +249,8 @@ public class Spell implements StackObject, Card {
return result;
} else {
//20091005 - 608.2b
game.informPlayers(getName() + " has been fizzled.");
if (!game.isSimulation())
game.informPlayers(getName() + " has been fizzled.");
counter(null, game);
return false;
}
@ -399,7 +401,7 @@ public class Spell implements StackObject, Card {
}
}
if (newTargetDescription.length() > 0) {
if (newTargetDescription.length() > 0 && !game.isSimulation()) {
game.informPlayers(this.getName() + " is now " + newTargetDescription.toString());
}
return true;
@ -430,7 +432,7 @@ public class Spell implements StackObject, Card {
if (forceChange && target.possibleTargets(this.getSourceId(), getControllerId(), game).size() > 1) { // controller of spell must be used (e.g. TargetOpponent)
int iteration = 0;
do {
if (iteration > 0) {
if (iteration > 0 && !game.isSimulation()) {
game.informPlayer(player, "You may only select exactly one target that must be different from the origin target!");
}
iteration++;