|
|
|
@ -115,6 +115,7 @@ class HHBuilder { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun availableActions(index: Int) : Set<Action.Type> { |
|
|
|
fun availableActions(index: Int) : Set<Action.Type> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val position = this.actionForIndex(index).position |
|
|
|
val lastSignificantAction: ComputedAction? = getStreetLastSignificantAction(index) |
|
|
|
val lastSignificantAction: ComputedAction? = getStreetLastSignificantAction(index) |
|
|
|
val lastUserAction: ComputedAction? = getLastUserAction(index) |
|
|
|
val lastUserAction: ComputedAction? = getLastUserAction(index) |
|
|
|
|
|
|
|
|
|
|
|
@ -125,8 +126,12 @@ class HHBuilder { |
|
|
|
|
|
|
|
|
|
|
|
when (lastSignificantAction.action.type) { |
|
|
|
when (lastSignificantAction.action.type) { |
|
|
|
Action.Type.POST_BB, Action.Type.STRADDLE -> { |
|
|
|
Action.Type.POST_BB, Action.Type.STRADDLE -> { |
|
|
|
|
|
|
|
if (position == lastSignificantAction.position) { |
|
|
|
|
|
|
|
setOf(Action.Type.FOLD, Action.Type.CHECK, Action.Type.BET, Action.Type.UNDEFINED_ALLIN) |
|
|
|
|
|
|
|
} else { |
|
|
|
setOf(Action.Type.STRADDLE, Action.Type.FOLD, Action.Type.CALL, Action.Type.BET, Action.Type.UNDEFINED_ALLIN) |
|
|
|
setOf(Action.Type.STRADDLE, Action.Type.FOLD, Action.Type.CALL, Action.Type.BET, Action.Type.UNDEFINED_ALLIN) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
Action.Type.BET, Action.Type.RAISE -> { |
|
|
|
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) |
|
|
|
@ -149,7 +154,7 @@ class HHBuilder { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setOf(Action.Type.CHECK, Action.Type.BET, Action.Type.BET_ALLIN) |
|
|
|
setOf(Action.Type.CHECK, Action.Type.BET, Action.Type.UNDEFINED_ALLIN) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -777,7 +782,10 @@ class HHBuilder { |
|
|
|
val activePositions = activePositions(index) |
|
|
|
val activePositions = activePositions(index) |
|
|
|
val activePlayerCount = activePositions.size // don't move this line because of removes |
|
|
|
val activePlayerCount = activePositions.size // don't move this line because of removes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Blinds must act |
|
|
|
|
|
|
|
if (!significantAction.action.type!!.isBlind) { |
|
|
|
activePositions.remove(significantAction.position) |
|
|
|
activePositions.remove(significantAction.position) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val significantIndex = significantAction.action.index |
|
|
|
val significantIndex = significantAction.action.index |
|
|
|
for (i in significantIndex + 1 until this.sortedActions.size) { |
|
|
|
for (i in significantIndex + 1 until this.sortedActions.size) { |
|
|
|
|