[refactor] removed generic parameter from Spell

This commit is contained in:
North 2014-05-31 23:19:26 +03:00
parent 289412bbc0
commit e43bc35c14
3 changed files with 6 additions and 7 deletions

View file

@ -224,7 +224,7 @@ public class CardView extends SimpleCardView {
if (card instanceof Spell) {
this.mageObjectType = MageObjectType.SPELL;
Spell<?> spell = (Spell<?>) card;
Spell spell = (Spell) card;
for (SpellAbility spellAbility: spell.getSpellAbilities()) {
for(UUID modeId : spellAbility.getModes().getSelectedModes()) {
spellAbility.getModes().setMode(spellAbility.getModes().get(modeId));

View file

@ -831,7 +831,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
}
} else {
if (object instanceof Spell) {
Spell<?> spell = (Spell<?>) object;
Spell spell = (Spell) object;
String castText = spell.getSpellAbility().toString();
sb.append((castText.startsWith("Cast ") ? castText.substring(5):castText));
if (spell.getFromZone() == Zone.GRAVEYARD) {
@ -847,7 +847,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
}
if (object instanceof Spell && ((Spell) object).getSpellAbilities().size() > 1) {
if (((Spell) object).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) {
Spell<?> spell = (Spell<?>) object;
Spell spell = (Spell) object;
int i = 0;
for (SpellAbility spellAbility : spell.getSpellAbilities()) {
i++;
@ -865,7 +865,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
}
}
} else {
Spell<?> spell = (Spell<?>) object;
Spell spell = (Spell) object;
int i = 0;
for (SpellAbility spellAbility : spell.getSpellAbilities()) {
i++;

View file

@ -67,9 +67,8 @@ import mage.watchers.Watcher;
/**
*
* @author BetaSteward_at_googlemail.com
* @param <T>
*/
public class Spell<T extends Spell<T>> implements StackObject, Card {
public class Spell implements StackObject, Card {
private final List<Card> spellCards = new ArrayList<>();
private final List<SpellAbility> spellAbilities = new ArrayList<>();
@ -100,7 +99,7 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
this.fromZone = fromZone;
}
public Spell(final Spell<T> spell) {
public Spell(final Spell spell) {
this.id = spell.id;
for (SpellAbility spellAbility: spell.spellAbilities) {
this.spellAbilities.add(spellAbility.copy());