summaryrefslogtreecommitdiff
path: root/sw-bot
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2020-11-27 01:00:04 +0100
committerjoffrey-bion <joffrey.bion@gmail.com>2020-11-28 02:26:32 +0100
commit132fcc3222245f02e5425617a15c90752b26b218 (patch)
tree64d40d9418cc4140ee4f28ef8a4760962f731f29 /sw-bot
parentAdd blueprintjs Dialog component (diff)
downloadseven-wonders-132fcc3222245f02e5425617a15c90752b26b218.tar.gz
seven-wonders-132fcc3222245f02e5425617a15c90752b26b218.tar.bz2
seven-wonders-132fcc3222245f02e5425617a15c90752b26b218.zip
Add dialog to choose who to buy resources from
Resolves: https://github.com/joffrey-bion/seven-wonders/issues/50
Diffstat (limited to 'sw-bot')
-rw-r--r--sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt b/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt
index 8ceae2c2..e3d54314 100644
--- a/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt
+++ b/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt
@@ -73,7 +73,9 @@ private fun createPlayCardMove(turnInfo: PlayerTurnInfo): PlayerMove {
val transactions = wonderBuildability.cheapestTransactions.random()
return PlayerMove(MoveType.UPGRADE_WONDER, hand.random().name, transactions)
}
- val playableCard = hand.filter { it.playability.isPlayable }.randomOrNull()
+ val playableCard = hand
+ .filter { it.playability.isPlayable }
+ .randomOrNull()
return if (playableCard != null) {
PlayerMove(MoveType.PLAY, playableCard.name, playableCard.playability.cheapestTransactions.random())
} else {
bgstack15