Renamed parameter name. [UI] Fixed big card image blinking on mouse move

This commit is contained in:
magenoxx 2012-07-21 14:10:07 +04:00
parent 3085710878
commit 6fbf4c1257
4 changed files with 19 additions and 10 deletions

View file

@ -251,7 +251,7 @@ public class MageActionCallback implements ActionCallback {
}
displayCard(card.getOriginal(), data);
} else {
hideCard();
//hideCard();
}
}

View file

@ -42,12 +42,12 @@ import java.util.UUID;
*
* @author BetaSteward_at_googlemail.com
*/
public class TriggeredAbilities extends HashMap<UUID, TriggeredAbility> {
public class TriggeredAbilities extends HashMap<String, TriggeredAbility> {
public TriggeredAbilities() {}
public TriggeredAbilities(final TriggeredAbilities abilities) {
for (Map.Entry<UUID, TriggeredAbility> entry: abilities.entrySet()) {
for (Map.Entry<String, TriggeredAbility> entry: abilities.entrySet()) {
this.put(entry.getKey(), entry.getValue().copy());
}
}
@ -96,8 +96,16 @@ public class TriggeredAbilities extends HashMap<UUID, TriggeredAbility> {
return object;
}
public void add(TriggeredAbility ability) {
this.put(ability.getId(), ability);
public void add(TriggeredAbility ability, MageObject attachedTo) {
this.put(getKey(ability, attachedTo), ability);
}
private String getKey(TriggeredAbility ability, MageObject target) {
String key = ability.getId() + "_";
if (target != null) {
key += target.getId();
}
return key;
}
public TriggeredAbilities copy() {

View file

@ -29,6 +29,7 @@
package mage.game;
import mage.Constants.Zone;
import mage.MageObject;
import mage.abilities.*;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffects;
@ -435,11 +436,11 @@ public class GameState implements Serializable, Copyable<GameState> {
watchers.add(watcher);
}
for (Ability ability: card.getAbilities()) {
addAbility(ability);
addAbility(ability, card);
}
}
public void addAbility(Ability ability) {
public void addAbility(Ability ability, MageObject attachedTo) {
if (ability instanceof StaticAbility) {
if (ability instanceof KickerAbility) {
return;
@ -453,14 +454,14 @@ public class GameState implements Serializable, Copyable<GameState> {
}
}
else if (ability instanceof TriggeredAbility) {
this.triggers.add((TriggeredAbility)ability);
this.triggers.add((TriggeredAbility)ability, attachedTo);
}
}
public void addEmblem(Emblem emblem) {
getCommand().add(emblem);
for (Ability ability: emblem.getAbilities()) {
addAbility(ability);
addAbility(ability, emblem);
}
}

View file

@ -177,7 +177,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
Ability copy = ability.copy();
copy.setControllerId(controllerId);
copy.setSourceId(objectId);
game.getState().addAbility(copy);
game.getState().addAbility(copy, this);
abilities.add(copy);
}
}