merge fix

This commit is contained in:
Oleg Agafonov 2025-06-13 23:52:59 +04:00
parent 62eb116124
commit eec4f0ac7e
3 changed files with 11 additions and 16 deletions

View file

@ -26,6 +26,7 @@ public abstract class CardWithSpellOption extends CardImpl {
public CardWithSpellOption(CardWithSpellOption card) {
super(card);
// make sure all parts created and parent ref added
this.spellCard = card.getSpellCard().copy();
this.spellCard.setParentCard(this);
}

View file

@ -62,14 +62,11 @@ public abstract class ModalDoubleFacedCard extends CardImpl implements CardWithH
public ModalDoubleFacedCard(ModalDoubleFacedCard card) {
super(card);
if (card.leftHalfCard != null) {
this.leftHalfCard = card.leftHalfCard.copy();
((ModalDoubleFacedCardHalf) this.leftHalfCard).setParentCard(this);
}
if (card.rightHalfCard != null) {
// make sure all parts created and parent ref added
this.leftHalfCard = card.getLeftHalfCard().copy();
((ModalDoubleFacedCardHalf) leftHalfCard).setParentCard(this);
this.rightHalfCard = card.rightHalfCard.copy();
((ModalDoubleFacedCardHalf) this.rightHalfCard).setParentCard(this);
}
((ModalDoubleFacedCardHalf) rightHalfCard).setParentCard(this);
}
public ModalDoubleFacedCardHalf getLeftHalfCard() {

View file

@ -38,14 +38,11 @@ public abstract class SplitCard extends CardImpl implements CardWithHalves {
protected SplitCard(SplitCard card) {
super(card);
if (card.leftHalfCard != null) {
this.leftHalfCard = card.leftHalfCard.copy();
((SplitCardHalf) this.leftHalfCard).setParentCard(this);
}
if (card.rightHalfCard != null) {
// make sure all parts created and parent ref added
this.leftHalfCard = card.getLeftHalfCard().copy();
((SplitCardHalf) leftHalfCard).setParentCard(this);
this.rightHalfCard = card.rightHalfCard.copy();
((SplitCardHalf) this.rightHalfCard).setParentCard(this);
}
((SplitCardHalf) rightHalfCard).setParentCard(this);
}
public void setParts(SplitCardHalf leftHalfCard, SplitCardHalf rightHalfCard) {