From 132fcc3222245f02e5425617a15c90752b26b218 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Fri, 27 Nov 2020 01:00:04 +0100 Subject: Add dialog to choose who to buy resources from Resolves: https://github.com/joffrey-bion/seven-wonders/issues/50 --- sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sw-bot/src/main/kotlin/org/luxons') 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 { -- cgit