diff options
author | joffrey-bion <joffrey.bion@gmail.com> | 2020-11-28 00:21:43 +0100 |
---|---|---|
committer | joffrey-bion <joffrey.bion@gmail.com> | 2020-11-28 02:26:32 +0100 |
commit | b8a6afedb14a1d54d77df918dc1d5b53be11c44b (patch) | |
tree | 58143efb9ab9e91dc045dc5ddbb5aeca99ef3596 /sw-bot/src/main/kotlin/org | |
parent | Add dialog to choose who to buy resources from (diff) | |
download | seven-wonders-b8a6afedb14a1d54d77df918dc1d5b53be11c44b.tar.gz seven-wonders-b8a6afedb14a1d54d77df918dc1d5b53be11c44b.tar.bz2 seven-wonders-b8a6afedb14a1d54d77df918dc1d5b53be11c44b.zip |
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
Diffstat (limited to 'sw-bot/src/main/kotlin/org')
-rw-r--r-- | sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt | 4 |
1 files changed, 2 insertions, 2 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 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()) } |