forked from External/mage
Refactor batch events (#11995)
* create new abstract class for batch event framework * adjust CardUtil.getEventTargets to support new framework * update TappedBatchEvent to new framework * update UntappedBatchEvent to new framework * slight cleanup * update LifeLostBatchEvent to new framework * update ZoneChangeBatchEvent to new framework * complete refactor by moving damage events to new framework * remove old code no longer used * clean up some nonsense code in star wars card * fix watcher checking id before event type * fix wrong id usage * fix missed wrong id usage
This commit is contained in:
parent
8869d282b2
commit
cb28fb5a56
39 changed files with 308 additions and 635 deletions
|
|
@ -3,11 +3,15 @@ package mage.game.events;
|
|||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public class DamagedBatchForOnePlayerEvent extends DamagedBatchEvent {
|
||||
public class DamagedBatchForOnePlayerEvent extends BatchEvent<DamagedPlayerEvent> {
|
||||
|
||||
public DamagedBatchForOnePlayerEvent(DamagedEvent firstEvent) {
|
||||
super(EventType.DAMAGED_BATCH_FOR_ONE_PLAYER, DamagedPlayerEvent.class);
|
||||
setPlayerId(firstEvent.getPlayerId());
|
||||
addEvent(firstEvent);
|
||||
public DamagedBatchForOnePlayerEvent(DamagedPlayerEvent firstEvent) {
|
||||
super(EventType.DAMAGED_BATCH_FOR_ONE_PLAYER, true, firstEvent);
|
||||
}
|
||||
|
||||
public boolean isCombatDamage() {
|
||||
return getEvents()
|
||||
.stream()
|
||||
.anyMatch(DamagedEvent::isCombatDamage);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue