Now StackAbilityView has sourceCard. Added displaying source card for abilities. Fixed arrows offsets. Added "source" blue arrows (target arrows are red). Fixed NullPointerException happen for AbilityPicker. Fixed random order of spells in stack. Code clean up.

This commit is contained in:
magenoxx 2010-11-27 15:29:48 +00:00
parent a910b59399
commit 03cb41f2aa
10 changed files with 110 additions and 139 deletions

View file

@ -29,6 +29,7 @@
package mage.view;
import java.util.ArrayList;
import mage.game.stack.StackAbility;
/**
@ -38,11 +39,13 @@ import mage.game.stack.StackAbility;
public class StackAbilityView extends CardView {
private String sourceName;
private CardView sourceCard;
public StackAbilityView(StackAbility ability, String sourceName) {
public StackAbilityView(StackAbility ability, String sourceName, CardView sourceCard) {
this.id = ability.getId();
this.name = "Ability";
this.sourceName = sourceName;
this.sourceCard = sourceCard;
this.rules = new ArrayList<String>();
rules.add(formatRule(ability.getRule()));
this.power = ability.getPower().toString();
@ -54,6 +57,7 @@ public class StackAbilityView extends CardView {
this.color = ability.getColor();
this.manaCost = ability.getManaCost().getSymbols();
this.art = "";
setTargets(ability.getTargets());
}
@Override
@ -62,5 +66,8 @@ public class StackAbilityView extends CardView {
newRule.replace("{source}", this.sourceName);
return newRule;
}
public CardView getSourceCard() {
return this.sourceCard;
}
}