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:
xenohedron 2024-03-28 23:19:20 -04:00 committed by GitHub
parent 8869d282b2
commit cb28fb5a56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 308 additions and 635 deletions

View file

@ -599,7 +599,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
game.getTurnStepType() == PhaseStep.UNTAP
);
game.fireEvent(event);
game.getState().addSimultaneousUntapped(event, game);
game.getState().addSimultaneousUntappedToBatch(event, game);
return true;
}
return false;
@ -617,7 +617,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
this.tapped = true;
TappedEvent event = new TappedEvent(objectId, source, source == null ? null : source.getControllerId(), forCombat);
game.fireEvent(event);
game.getState().addSimultaneousTapped(event, game);
game.getState().addSimultaneousTappedToBatch(event, game);
return true;
}
return false;