summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/src/api/model.js1
-rw-r--r--game-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt16
-rw-r--r--game-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt1
3 files changed, 11 insertions, 7 deletions
diff --git a/frontend/src/api/model.js b/frontend/src/api/model.js
index cd718ff1..78846afd 100644
--- a/frontend/src/api/model.js
+++ b/frontend/src/api/model.js
@@ -119,6 +119,7 @@ export type ApiPlayerTurnInfo = {
currentAge: number,
action: ApiAction,
hand: ApiHandCard[],
+ playedMove: ApiPlayedMove | null,
neighbourGuildCards: ApiTableCard[],
message: string,
wonderBuildability: ApiWonderBuildability,
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
bgstack15