mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed mock split card generation. Fixes #3444.
Implementation was missing - copied it from actual split cards.
This commit is contained in:
parent
485ea2729a
commit
12a520c85a
2 changed files with 7 additions and 2 deletions
|
@ -5,6 +5,7 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.SplitCard;
|
import mage.cards.SplitCard;
|
||||||
|
import mage.cards.SplitCardHalf;
|
||||||
import mage.cards.repository.CardInfo;
|
import mage.cards.repository.CardInfo;
|
||||||
import mage.cards.repository.CardRepository;
|
import mage.cards.repository.CardRepository;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -52,11 +53,13 @@ public class MockSplitCard extends SplitCard {
|
||||||
CardInfo leftHalf = CardRepository.instance.findCard(getLeftHalfName(card));
|
CardInfo leftHalf = CardRepository.instance.findCard(getLeftHalfName(card));
|
||||||
if (leftHalf != null) {
|
if (leftHalf != null) {
|
||||||
this.leftHalfCard = new MockSplitCardHalf(leftHalf);
|
this.leftHalfCard = new MockSplitCardHalf(leftHalf);
|
||||||
|
((SplitCardHalf)this.leftHalfCard).setParentCard(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
CardInfo rightHalf = CardRepository.instance.findCard(getRightHalfName(card));
|
CardInfo rightHalf = CardRepository.instance.findCard(getRightHalfName(card));
|
||||||
if (rightHalf != null) {
|
if (rightHalf != null) {
|
||||||
this.rightHalfCard = new MockSplitCardHalf(rightHalf);
|
this.rightHalfCard = new MockSplitCardHalf(rightHalf);
|
||||||
|
((SplitCardHalf)this.rightHalfCard).setParentCard(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ import mage.cards.repository.CardInfo;
|
||||||
*/
|
*/
|
||||||
public class MockSplitCardHalf extends MockCard implements SplitCardHalf {
|
public class MockSplitCardHalf extends MockCard implements SplitCardHalf {
|
||||||
|
|
||||||
|
SplitCard splitCardParent;
|
||||||
|
|
||||||
public MockSplitCardHalf(CardInfo card) {
|
public MockSplitCardHalf(CardInfo card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -52,12 +54,12 @@ public class MockSplitCardHalf extends MockCard implements SplitCardHalf {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setParentCard(SplitCard card) {
|
public void setParentCard(SplitCard card) {
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
this.splitCardParent = card;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SplitCard getParentCard() {
|
public SplitCard getParentCard() {
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
return splitCardParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue