99import { TurnOrder } from './turn-order' ;
1010import { Random } from './random' ;
1111import { Events } from './events' ;
12- import { gameEvent } from './action-creators' ;
12+ import { automaticGameEvent } from './action-creators' ;
1313
1414/**
1515 * Helper to create a reducer that manages ctx (with the
@@ -419,7 +419,7 @@ export function FlowWithPhases({
419419 if ( end ) {
420420 state = this . dispatch (
421421 state ,
422- gameEvent ( 'endPhase' , [ end , cascadeDepth + 1 ] , this . playerID )
422+ automaticGameEvent ( 'endPhase' , [ end , cascadeDepth + 1 ] , this . playerID )
423423 ) ;
424424 }
425425 }
@@ -430,7 +430,7 @@ export function FlowWithPhases({
430430 if ( endTurn && state . ctx . turn == origTurn ) {
431431 state = this . dispatch (
432432 state ,
433- gameEvent ( 'endTurn' , [ endTurn ] , this . playerID )
433+ automaticGameEvent ( 'endTurn' , [ endTurn ] , this . playerID )
434434 ) ;
435435 }
436436
@@ -494,7 +494,7 @@ export function FlowWithPhases({
494494 if ( end ) {
495495 return this . dispatch (
496496 { ...state , G, ctx } ,
497- gameEvent ( 'endPhase' , [ end ] , this . playerID )
497+ automaticGameEvent ( 'endPhase' , [ end ] , this . playerID )
498498 ) ;
499499 }
500500
@@ -536,7 +536,7 @@ export function FlowWithPhases({
536536 if ( endPhase || gameover !== undefined ) {
537537 state = dispatch (
538538 state ,
539- gameEvent ( 'endPhase' , [ endPhase ] , action . playerID )
539+ automaticGameEvent ( 'endPhase' , [ endPhase ] , action . playerID )
540540 ) ;
541541 // Update to the new phase configuration
542542 conf = phaseMap [ state . ctx . phase ] ;
@@ -546,7 +546,10 @@ export function FlowWithPhases({
546546 // (but not if endPhase above already ends the turn).
547547 const endTurn = shouldEndTurn ( state ) ;
548548 if ( state . ctx . turn == origTurn && ( endTurn || gameover !== undefined ) ) {
549- state = dispatch ( state , gameEvent ( 'endTurn' , [ endTurn ] , action . playerID ) ) ;
549+ state = dispatch (
550+ state ,
551+ automaticGameEvent ( 'endTurn' , [ endTurn ] , action . playerID )
552+ ) ;
550553 }
551554
552555 // End the game automatically if endGameIf returns.
0 commit comments