|
|
|
@ -62,24 +62,25 @@ class Builder { |
|
|
|
|
|
|
|
|
|
|
|
return if (lastSignificantAction != null) { |
|
|
|
return if (lastSignificantAction != null) { |
|
|
|
|
|
|
|
|
|
|
|
when (val actionType = lastSignificantAction.action.type) { |
|
|
|
|
|
|
|
Action.Type.POST_BB, Action.Type.STRADDLE -> setOf(Action.Type.STRADDLE, Action.Type.FOLD, Action.Type.CALL, Action.Type.BET, Action.Type.BET_ALLIN) |
|
|
|
|
|
|
|
Action.Type.BET, Action.Type.RAISE, Action.Type.RAISE_ALLIN, Action.Type.BET_ALLIN -> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val remainingStack = lastUserAction?.playerRemainingStack |
|
|
|
val remainingStack = lastUserAction?.playerRemainingStack |
|
|
|
val actionAmount = lastSignificantAction.action.amount |
|
|
|
val actionAmount = lastSignificantAction.action.amount |
|
|
|
|
|
|
|
|
|
|
|
if ((actionType == Action.Type.RAISE_ALLIN || actionType == Action.Type.BET_ALLIN) |
|
|
|
when (lastSignificantAction.action.type) { |
|
|
|
&& this.remainingPlayerCount == 2) { |
|
|
|
Action.Type.POST_BB, Action.Type.STRADDLE -> { |
|
|
|
|
|
|
|
setOf(Action.Type.STRADDLE, Action.Type.FOLD, Action.Type.CALL, Action.Type.BET, Action.Type.BET_ALLIN) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Action.Type.BET, Action.Type.RAISE -> { |
|
|
|
if (remainingStack != null && actionAmount != null && remainingStack <= actionAmount) { |
|
|
|
if (remainingStack != null && actionAmount != null && remainingStack <= actionAmount) { |
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL_ALLIN) |
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL_ALLIN) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL) |
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL, Action.Type.RAISE, Action.Type.RAISE_ALLIN) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else if (remainingStack != null && actionAmount != null && remainingStack <= actionAmount) { |
|
|
|
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_ALLIN) |
|
|
|
|
|
|
|
} else if (this.remainingPlayerCount == 2 && remainingStack != null && actionAmount != null && remainingStack > actionAmount) { |
|
|
|
|
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL, Action.Type.RAISE, Action.Type.RAISE_ALLIN) |
|
|
|
setOf(Action.Type.FOLD, Action.Type.CALL, Action.Type.RAISE, Action.Type.RAISE_ALLIN) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -104,6 +105,10 @@ class Builder { |
|
|
|
// remove everything after |
|
|
|
// remove everything after |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun setAmount(index: Int, amount: Double) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun getLastUserAction(index: Int): ComputedAction? { |
|
|
|
private fun getLastUserAction(index: Int): ComputedAction? { |
|
|
|
val computedAction = this.sortedActions.first { it.action.index == index } |
|
|
|
val computedAction = this.sortedActions.first { it.action.index == index } |
|
|
|
val action = computedAction.action |
|
|
|
val action = computedAction.action |
|
|
|
|