mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
GameEventAttachment: flip oldTarget and newTarget param (#8761)
* GameEventAttachment: flip oldTarget and newTarget param --------- Co-authored-by: tool4EvEr <tool4EvEr@>
This commit is contained in:
@@ -34,7 +34,6 @@ import forge.game.card.CardCollectionView;
|
|||||||
import forge.game.card.CardLists;
|
import forge.game.card.CardLists;
|
||||||
import forge.game.card.CardPredicates;
|
import forge.game.card.CardPredicates;
|
||||||
import forge.game.card.CounterType;
|
import forge.game.card.CounterType;
|
||||||
import forge.game.event.GameEventCardAttachment;
|
|
||||||
import forge.game.keyword.Keyword;
|
import forge.game.keyword.Keyword;
|
||||||
import forge.game.keyword.KeywordInterface;
|
import forge.game.keyword.KeywordInterface;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -196,14 +195,12 @@ public abstract class GameEntity extends GameObject implements IIdentifiable {
|
|||||||
public final void addAttachedCard(final Card c) {
|
public final void addAttachedCard(final Card c) {
|
||||||
if (attachedCards.add(c)) {
|
if (attachedCards.add(c)) {
|
||||||
updateAttachedCards();
|
updateAttachedCards();
|
||||||
getGame().fireEvent(new GameEventCardAttachment(c, null, this));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void removeAttachedCard(final Card c) {
|
public final void removeAttachedCard(final Card c) {
|
||||||
if (attachedCards.remove(c)) {
|
if (attachedCards.remove(c)) {
|
||||||
updateAttachedCards();
|
updateAttachedCards();
|
||||||
getGame().fireEvent(new GameEventCardAttachment(c, this, null));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package forge.game.event;
|
|||||||
import forge.game.GameEntity;
|
import forge.game.GameEntity;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
|
|
||||||
public record GameEventCardAttachment(Card equipment, GameEntity newTarget, GameEntity oldEntity) implements GameEvent {
|
public record GameEventCardAttachment(Card equipment, GameEntity oldEntity, GameEntity newTarget) implements GameEvent {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T visit(IGameEventVisitor<T> visitor) {
|
public <T> T visit(IGameEventVisitor<T> visitor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user