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

@ -100,9 +100,10 @@ public class SpellStack extends ArrayDeque<StackObject> {
}
this.remove(stackObject);
stackObject.counter(sourceId, game); // tries to move to graveyard
game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName());
if (!game.isSimulation())
game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName());
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId()));
} else {
} else if (!game.isSimulation()) {
game.informPlayers(counteredObjectName + " could not be countered by " + sourceObject.getLogName());
}
return true;