diff options
author | joffrey-bion <joffrey.bion@gmail.com> | 2020-11-27 01:00:04 +0100 |
---|---|---|
committer | joffrey-bion <joffrey.bion@gmail.com> | 2020-11-28 02:26:32 +0100 |
commit | 132fcc3222245f02e5425617a15c90752b26b218 (patch) | |
tree | 64d40d9418cc4140ee4f28ef8a4760962f731f29 /sw-bot/src | |
parent | Add blueprintjs Dialog component (diff) | |
download | seven-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/src')
-rw-r--r-- | sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt | 4 |
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 { |