summaryrefslogtreecommitdiff
path: root/sw-ui/src/main/kotlin
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-05-23 00:12:43 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-05-23 00:12:43 +0200
commit96161e98cae0ada6a9156893b5c9c0a38506d619 (patch)
tree59c074a1e0984aa235d149fdcff6499a015ef658 /sw-ui/src/main/kotlin
parentRemove bot delays for joining the game (diff)
downloadseven-wonders-96161e98cae0ada6a9156893b5c9c0a38506d619.tar.gz
seven-wonders-96161e98cae0ada6a9156893b5c9c0a38506d619.tar.bz2
seven-wonders-96161e98cae0ada6a9156893b5c9c0a38506d619.zip
Play default cheapest transactions
Diffstat (limited to 'sw-ui/src/main/kotlin')
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt
index b86f1894..21de1de5 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt
@@ -38,6 +38,7 @@ import kotlinx.html.DIV
import org.luxons.sevenwonders.model.MoveType
import org.luxons.sevenwonders.model.PlayerMove
import org.luxons.sevenwonders.model.cards.HandCard
+import org.luxons.sevenwonders.model.resources.noTransactions
import react.RBuilder
import styled.StyledDOMBuilder
import styled.css
@@ -100,19 +101,20 @@ private fun RBuilder.actionButtons(card: HandCard, wonderUpgradable: Boolean, pr
display = Display.flex
}
}
+ val transactions = card.playability.cheapestTransactions.firstOrNull() ?: noTransactions()
bpButtonGroup {
bpButton(title = "PLAY",
large = true,
intent = Intent.SUCCESS,
icon = "play",
disabled = !card.playability.isPlayable,
- onClick = { prepareMove(PlayerMove(MoveType.PLAY, card.name)) })
+ onClick = { prepareMove(PlayerMove(MoveType.PLAY, card.name, transactions)) })
bpButton(title = "UPGRADE WONDER",
large = true,
intent = Intent.PRIMARY,
icon = "key-shift",
disabled = !wonderUpgradable,
- onClick = { prepareMove(PlayerMove(MoveType.UPGRADE_WONDER, card.name)) })
+ onClick = { prepareMove(PlayerMove(MoveType.UPGRADE_WONDER, card.name, transactions)) })
bpButton(title = "DISCARD",
large = true,
intent = Intent.DANGER,
bgstack15