|
|
|
|
@ -62,14 +62,23 @@ class Builder { |
|
|
|
|
|
|
|
|
|
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.BET, Action.Type.RAISE, Action.Type.RAISE_ALLIN, Action.Type.BET_ALLIN -> { |
|
|
|
|
|
|
|
|
|
val remainingStack = lastUserAction?.playerRemainingStack |
|
|
|
|
val actionAmount = lastSignificantAction.action.amount |
|
|
|
|
|
|
|
|
|
if (remainingStack != null && actionAmount != null && remainingStack <= actionAmount) { |
|
|
|
|
if ((actionType == Action.Type.RAISE_ALLIN || actionType == Action.Type.BET_ALLIN) |
|
|
|
|
&& this.remainingPlayerCount == 2) { |
|
|
|
|
|
|
|
|
|
if (remainingStack != null && actionAmount != null && remainingStack <= actionAmount) { |
|
|
|
|
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 { |
|
|
|
|
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) { |
|
|
|
|
// remove everything after |
|
|
|
|
} |
|
|
|
|
|