From 0402dcc9f2bacc5445748ad8633262fedbf5b5ad Mon Sep 17 00:00:00 2001 From: jbion Date: Wed, 27 Feb 2019 22:50:06 +0100 Subject: Add prepared move in turnInfo --- .../src/main/kotlin/org/luxons/sevenwonders/game/Game.kt | 16 +++++++++------- .../org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'game-engine/src') 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, + val preparedMove: PlayedMove?, val neighbourGuildCards: List ) { val currentAge: Int = table.currentAge -- cgit