|
|
|
|
@ -200,7 +200,7 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
|
} |
|
|
|
|
Action.Type.RAISE_ALLIN, Action.Type.BET_ALLIN -> { |
|
|
|
|
if (remainingStack != null && actionAmount != null && remainingStack <= actionAmount) { |
|
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL_ALLIN) |
|
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL) |
|
|
|
|
} else if (activePositions(index).size == 2 && remainingStack != null && actionAmount != null && remainingStack > actionAmount) { |
|
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL) |
|
|
|
|
} else { |
|
|
|
|
@ -632,4 +632,24 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
* Updates all ComputedAction linked to the position with an updated value of the remaining stack |
|
|
|
|
*/ |
|
|
|
|
fun stackUpdatedAtPosition(positionIndex: Int) { |
|
|
|
|
this.handHistory.playerSetupForPosition(positionIndex)?.let { playerSetup -> |
|
|
|
|
|
|
|
|
|
var remainingStack = playerSetup.stack |
|
|
|
|
this.filter { it.action.position == positionIndex }.forEach { ca -> |
|
|
|
|
|
|
|
|
|
remainingStack?.let { rs -> |
|
|
|
|
remainingStack = rs - ca.action.effectiveAmount |
|
|
|
|
ca.playerRemainingStack = remainingStack |
|
|
|
|
} ?: run { |
|
|
|
|
ca.playerRemainingStack = null |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} ?: throw PAIllegalStateException("Can't happen") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|