foul-magics/Mage/src/main/java/mage/game/events/TargetEvent.java
Susucre 95adcf0e9a revert the GameEvent::setSourceId removal
xenodron mentionned that one of the use of setSourceId is to more easily find the Event that use non-standard
sourceId.

So reverting the change made in a previous commit.

It was a non-functional change meant to ease new
BatchEvent sharing sourceId, but I'll use setSourceId
instead there.
2024-04-30 11:51:11 +02:00

36 lines
1,021 B
Java

package mage.game.events;
import mage.abilities.Ability;
import mage.cards.Card;
import mage.players.Player;
import java.util.UUID;
/**
* @author JayDi85
*/
public class TargetEvent extends GameEvent {
/**
* @param target
* @param sourceId
* @param sourceControllerId can be different from real controller (example: ability instructs another player to targeting)
*/
public TargetEvent(Card target, UUID sourceId, UUID sourceControllerId) {
super(GameEvent.EventType.TARGET, target.getId(), null, sourceControllerId);
this.setSourceId(sourceId);
}
public TargetEvent(Player target, UUID sourceId, UUID sourceControllerId) {
super(GameEvent.EventType.TARGET, target.getId(), null, sourceControllerId);
this.setSourceId(sourceId);
}
/**
* @param targetId
* @param source
*/
public TargetEvent(UUID targetId, Ability source) {
super(GameEvent.EventType.TARGET, targetId, source, source.getControllerId());
}
}