mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Some fixes to cardState handling concerning card rules.
This commit is contained in:
parent
c7c594ca3c
commit
84e2ecb8ef
2 changed files with 12 additions and 4 deletions
|
@ -198,7 +198,11 @@ public class CardView extends SimpleCardView {
|
||||||
|
|
||||||
this.name = card.getImageName();
|
this.name = card.getImageName();
|
||||||
this.displayName = card.getName();
|
this.displayName = card.getName();
|
||||||
this.rules = card.getRules(game);
|
if (game == null) {
|
||||||
|
this.rules = card.getRules();
|
||||||
|
} else {
|
||||||
|
this.rules = card.getRules(game);
|
||||||
|
}
|
||||||
this.manaCost = card.getManaCost().getSymbols();
|
this.manaCost = card.getManaCost().getSymbols();
|
||||||
this.convertedManaCost = card.getManaCost().convertedManaCost();
|
this.convertedManaCost = card.getManaCost().convertedManaCost();
|
||||||
|
|
||||||
|
|
|
@ -222,9 +222,13 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
||||||
public List<String> getRules(Game game) {
|
public List<String> getRules(Game game) {
|
||||||
try {
|
try {
|
||||||
List<String> rules = getRules();
|
List<String> rules = getRules();
|
||||||
CardState state = game.getState().getCardState(objectId);
|
if (game != null) {
|
||||||
for (String data : state.getInfo().values()) {
|
CardState cardState = game.getState().getCardState(objectId);
|
||||||
rules.add(data);
|
if (cardState != null) {
|
||||||
|
for (String data : cardState.getInfo().values()) {
|
||||||
|
rules.add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// for (Ability ability: state.getAbilities()) {
|
// for (Ability ability: state.getAbilities()) {
|
||||||
// rules.add(ability.getRule());
|
// rules.add(ability.getRule());
|
||||||
|
|
Loading…
Reference in a new issue