diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-08-09 13:04:54 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-08-09 13:06:09 +0200 |
commit | 833a043a35d36c9089f11d87d992c2491a3f1213 (patch) | |
tree | efdba2d364dc42b36a2c06b6c81760acf562fc5c /sw-engine | |
parent | Add screenshots to README (diff) | |
download | seven-wonders-833a043a35d36c9089f11d87d992c2491a3f1213.tar.gz seven-wonders-833a043a35d36c9089f11d87d992c2491a3f1213.tar.bz2 seven-wonders-833a043a35d36c9089f11d87d992c2491a3f1213.zip |
Fix discarded card play at end of age
Resolves:
https://github.com/joffrey-bion/seven-wonders/issues/36
Diffstat (limited to 'sw-engine')
-rw-r--r-- | sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt index da3ae5c7..34a8dd99 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt @@ -149,7 +149,9 @@ class Game internal constructor( */ fun playTurn(): TableState { makeMoves() - if (endOfAgeReached()) { + if (shouldStartPlayDiscardedTurn()) { + startPlayDiscardedTurn() + } else if (endOfAgeReached()) { executeEndOfAgeEvents() if (endOfGameReached()) { startEndGameTurn() @@ -157,12 +159,8 @@ class Game internal constructor( startNewAge() } } else { - if (shouldStartPlayDiscardedTurn()) { - startPlayDiscardedTurn() - } else { - rotateHandsIfRelevant() - startNewTurn() - } + rotateHandsIfRelevant() + startNewTurn() } return table.toTableState() } |