|
|
|
|
@ -128,12 +128,14 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
Action.Type.CALL -> { |
|
|
|
|
getStreetLastSignificantAction(computedAction.street, index - 1)?.action?.amount?.let { betAmount -> |
|
|
|
|
getStreetLastSignificantAction(computedAction.street, index - 1)?.let { |
|
|
|
|
val betAmount = it.action.amount ?: 0.0 |
|
|
|
|
val remainingStack = computedAction.stackBeforeActing |
|
|
|
|
if (remainingStack != null && remainingStack < betAmount) { |
|
|
|
|
type = Action.Type.CALL_ALLIN |
|
|
|
|
} |
|
|
|
|
} ?: throw PAIllegalStateException("Can't happen") |
|
|
|
|
} ?: throw PAIllegalStateException("Can't call without a significant action") |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else -> {} |
|
|
|
|
} |
|
|
|
|
@ -150,9 +152,13 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
|
/*** |
|
|
|
|
* Sets the amount for the action at the provided [index] |
|
|
|
|
*/ |
|
|
|
|
fun setAmount(index: Int, amount: Double) { |
|
|
|
|
fun setAmount(index: Int, amount: Double?) { |
|
|
|
|
val computedAction = this[index] |
|
|
|
|
computedAction.setBetAmount(amount) |
|
|
|
|
amount?.let { |
|
|
|
|
computedAction.setBetAmount(amount) |
|
|
|
|
} ?: run { |
|
|
|
|
computedAction.clearAmount() |
|
|
|
|
} |
|
|
|
|
this.updateRemainingStacksForPositions(listOf(computedAction.action.position)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|