Manage forgotten case to determine possible HH player action

hh
Laurent 6 years ago
parent e321014973
commit 6cee11edbe
  1. 16
      app/src/main/java/net/pokeranalytics/android/model/handhistory/Builder.kt

@ -62,15 +62,24 @@ class Builder {
return if (lastSignificantAction != null) { return if (lastSignificantAction != null) {
when (lastSignificantAction.action.type) { 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.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 -> { 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)
&& this.remainingPlayerCount == 2) {
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 {
setOf(Action.Type.FOLD, Action.Type.CALL)
}
} else if (remainingStack != null && actionAmount != null && remainingStack <= actionAmount) {
setOf(Action.Type.FOLD, Action.Type.CALL_ALLIN)
} 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)
} }
@ -86,6 +95,11 @@ class Builder {
} }
private val remainingPlayerCount: Int
get() {
return 0 // TODO
}
private fun selectAction(index: Int, actionType: Action.Type) { private fun selectAction(index: Int, actionType: Action.Type) {
// remove everything after // remove everything after
} }

Loading…
Cancel
Save