Added log for mana bug.

This commit is contained in:
LevelX2 2014-07-29 07:47:01 +02:00
parent 9f9d140fa5
commit 48f0437bc7

View file

@ -27,6 +27,7 @@
*/ */
package mage.abilities.effects.common.continious; package mage.abilities.effects.common.continious;
import java.util.Iterator;
import java.util.UUID; import java.util.UUID;
import mage.Mana; import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -34,8 +35,10 @@ import mage.abilities.effects.ReplacementEffectImpl;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.game.Game; import mage.game.Game;
import mage.game.command.CommandObject;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ManaEvent; import mage.game.events.ManaEvent;
import org.apache.log4j.Logger;
/** /**
* *
@ -49,6 +52,8 @@ import mage.game.events.ManaEvent;
*/ */
public class CommanderManaReplacementEffect extends ReplacementEffectImpl { public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
private static final transient Logger logger = Logger.getLogger(CommanderManaReplacementEffect.class);
private final UUID playerId; private final UUID playerId;
private final Mana commanderMana; private final Mana commanderMana;
@ -114,6 +119,16 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.ADD_MANA && event.getPlayerId().equals(playerId)) { if (event.getType() == GameEvent.EventType.ADD_MANA && event.getPlayerId().equals(playerId)) {
if (logger.isDebugEnabled()) {
if (!game.getGameType().toString().startsWith("Commander")) {
logger.debug("Non Commander game has active CommanderManaReplacementEffect");
Iterator it = game.getState().getCommand().iterator();
while (it.hasNext()) {
Object object = it.next();
logger.debug("Class: " + object.getClass() + " - " + object.toString());
}
}
}
return true; return true;
} }
return false; return false;