diff options
author | jbion <joffrey.bion@amadeus.com> | 2019-02-27 22:50:06 +0100 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2019-02-28 11:49:04 +0100 |
commit | 0402dcc9f2bacc5445748ad8633262fedbf5b5ad (patch) | |
tree | 9d1ff78f63ccb98cd2b5c441daf4c6bfdb0946b6 /game-engine/src | |
parent | Simplify state and reducers (diff) | |
download | seven-wonders-0402dcc9f2bacc5445748ad8633262fedbf5b5ad.tar.gz seven-wonders-0402dcc9f2bacc5445748ad8633262fedbf5b5ad.tar.bz2 seven-wonders-0402dcc9f2bacc5445748ad8633262fedbf5b5ad.zip |
Add prepared move in turnInfo
Diffstat (limited to 'game-engine/src')
-rw-r--r-- | game-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt | 16 | ||||
-rw-r--r-- | game-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt | 1 |
2 files changed, 10 insertions, 7 deletions
diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt index 124cf435..2892cc29 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt @@ -1,11 +1,6 @@ package org.luxons.sevenwonders.game -import org.luxons.sevenwonders.game.api.Action -import org.luxons.sevenwonders.game.api.HandCard -import org.luxons.sevenwonders.game.api.PlayerMove -import org.luxons.sevenwonders.game.api.PlayerTurnInfo -import org.luxons.sevenwonders.game.api.toApiTable -import org.luxons.sevenwonders.game.api.toTableCard +import org.luxons.sevenwonders.game.api.* import org.luxons.sevenwonders.game.boards.Board import org.luxons.sevenwonders.game.boards.Table import org.luxons.sevenwonders.game.cards.Card @@ -50,7 +45,14 @@ class Game internal constructor( val action = determineAction(hand, player.board) val neighbourGuildCards = table.getNeighbourGuildCards(player.index).map { it.toTableCard(null) } - return PlayerTurnInfo(player.index, table.toApiTable(), action, hand, neighbourGuildCards) + return PlayerTurnInfo( + playerIndex = player.index, + table = table.toApiTable(), + action = action, + hand = hand, + preparedMove = preparedMoves[player.index]?.toPlayedMove(), + neighbourGuildCards = neighbourGuildCards + ) } /** diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt index 9eccf935..1eefba81 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt @@ -15,6 +15,7 @@ data class PlayerTurnInfo internal constructor( val table: Table, val action: Action, val hand: List<HandCard>, + val preparedMove: PlayedMove?, val neighbourGuildCards: List<TableCard> ) { val currentAge: Int = table.currentAge |