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) { public CardWithSpellOption(CardWithSpellOption card) {
super(card); super(card);
// make sure all parts created and parent ref added
this.spellCard = card.getSpellCard().copy(); this.spellCard = card.getSpellCard().copy();
this.spellCard.setParentCard(this); this.spellCard.setParentCard(this);
} }

View file

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

View file

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