have separate turn events for extra beginning.

I did check the BEGINNING_PHASE_PRE usage, and found none that wanted to watch the extra beginning phases.

Of note, we may want to have separate 'beginning of turn'/'beginning of game' events, if there is ever a way to skip beginning phases.
This commit is contained in:
Susucre 2024-04-25 18:58:32 +02:00
parent ff4bd9b430
commit 1ae48593a8
2 changed files with 5 additions and 4 deletions

View file

@ -43,7 +43,8 @@ public class GameEvent implements Serializable {
PLAY_TURN, EXTRA_TURN,
CHANGE_PHASE, PHASE_CHANGED,
CHANGE_STEP, STEP_CHANGED,
BEGINNING_PHASE, BEGINNING_PHASE_PRE, BEGINNING_PHASE_POST,
BEGINNING_PHASE, BEGINNING_PHASE_PRE, BEGINNING_PHASE_POST, // The normal beginning phase -- at the beginning of turn
BEGINNING_PHASE_EXTRA, BEGINNING_PHASE_PRE_EXTRA, BEGINNING_PHASE_POST_EXTRA, // Extra beginning phase, 'as turn begun' watchers don't want to react on thoses.
UNTAP_STEP_PRE, UNTAP_STEP, UNTAP_STEP_POST,
UPKEEP_STEP_PRE, UPKEEP_STEP, UPKEEP_STEP_POST,
DRAW_STEP_PRE, DRAW_STEP, DRAW_STEP_POST,

View file

@ -21,9 +21,9 @@ public class BeginningPhase extends Phase {
public BeginningPhase(boolean isExtra) {
this.type = TurnPhase.BEGINNING;
this.event = EventType.BEGINNING_PHASE;
this.preEvent = EventType.BEGINNING_PHASE_PRE;
this.postEvent = EventType.BEGINNING_PHASE_POST;
this.event = isExtra ? EventType.BEGINNING_PHASE_EXTRA : EventType.BEGINNING_PHASE;
this.preEvent = isExtra ? EventType.BEGINNING_PHASE_PRE_EXTRA : EventType.BEGINNING_PHASE_PRE;
this.postEvent = isExtra ? EventType.BEGINNING_PHASE_PRE_EXTRA : EventType.BEGINNING_PHASE_POST;
this.steps.add(new UntapStep());
this.steps.add(new UpkeepStep());
this.steps.add(new DrawStep());