From b8a6afedb14a1d54d77df918dc1d5b53be11c44b Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Sat, 28 Nov 2020 00:21:43 +0100 Subject: Make all transactions available Sometimes the strategic move can be to spend more money on a different player, rather than less money on the wrong player. We need to make these strategic moves available through the UI. To make up for the explosion in combinations, we just have to get rid of the options that result in the same money for each neighbour. As long as we give the same amounts, we don't care whether it's for wood or clay. Related: https://github.com/joffrey-bion/seven-wonders/issues/50 --- sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw-bot/src/main/kotlin') 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 e3d54314..48a96f08 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 @@ -70,14 +70,14 @@ private fun createPlayCardMove(turnInfo: PlayerTurnInfo): PlayerMove { val hand = turnInfo.hand ?: error("Cannot choose move, no hand in current turn info!") val wonderBuildability = turnInfo.wonderBuildability if (wonderBuildability.isBuildable) { - val transactions = wonderBuildability.cheapestTransactions.random() + val transactions = wonderBuildability.transactionsOptions.random() return PlayerMove(MoveType.UPGRADE_WONDER, hand.random().name, transactions) } val playableCard = hand .filter { it.playability.isPlayable } .randomOrNull() return if (playableCard != null) { - PlayerMove(MoveType.PLAY, playableCard.name, playableCard.playability.cheapestTransactions.random()) + PlayerMove(MoveType.PLAY, playableCard.name, playableCard.playability.transactionOptions.random()) } else { PlayerMove(MoveType.DISCARD, hand.random().name, noTransactions()) } -- cgit