|
|
|
@ -148,7 +148,7 @@ class HHBuilder { |
|
|
|
* Also calculates the player effective amounts in proper cases |
|
|
|
* Also calculates the player effective amounts in proper cases |
|
|
|
* Returns the list of modified action indexes that are not the action at [index] |
|
|
|
* Returns the list of modified action indexes that are not the action at [index] |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun selectAction(index: Int, actionType: Action.Type) : List<Int> { |
|
|
|
fun selectAction(index: Int, actionType: Action.Type) : List<Int>? { |
|
|
|
|
|
|
|
|
|
|
|
Timber.d(">>> Sets $actionType at index: $index") |
|
|
|
Timber.d(">>> Sets $actionType at index: $index") |
|
|
|
|
|
|
|
|
|
|
|
@ -158,20 +158,6 @@ class HHBuilder { |
|
|
|
computedAction.action.amount = null |
|
|
|
computedAction.action.amount = null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dropNextActionsIfNecessary(index) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Automatically sets action for the previous empty actions |
|
|
|
|
|
|
|
val modifiedActions = mutableListOf<ComputedAction>() |
|
|
|
|
|
|
|
getPreviousEmptyActions(index).forEach { |
|
|
|
|
|
|
|
modifiedActions.add(it) |
|
|
|
|
|
|
|
val lastSignificant = getLastSignificantAction(index) |
|
|
|
|
|
|
|
if (lastSignificant != null) { |
|
|
|
|
|
|
|
it.action.type = Action.Type.FOLD |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
it.action.type = Action.Type.CHECK |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
when (actionType) { |
|
|
|
when (actionType) { |
|
|
|
Action.Type.CALL -> { |
|
|
|
Action.Type.CALL -> { |
|
|
|
val significantAction = getLastSignificantAction(index) |
|
|
|
val significantAction = getLastSignificantAction(index) |
|
|
|
@ -190,6 +176,21 @@ class HHBuilder { |
|
|
|
else -> {} |
|
|
|
else -> {} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val dropedIndex = dropNextActionsIfNecessary(index) // TODO returns the value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Automatically sets action for the previous empty actions |
|
|
|
|
|
|
|
val modifiedActions = mutableListOf<ComputedAction>() |
|
|
|
|
|
|
|
getPreviousEmptyActions(index).forEach { |
|
|
|
|
|
|
|
modifiedActions.add(it) |
|
|
|
|
|
|
|
val lastSignificant = getLastSignificantAction(index) |
|
|
|
|
|
|
|
if (lastSignificant != null) { |
|
|
|
|
|
|
|
it.action.type = Action.Type.FOLD |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
it.action.type = Action.Type.CHECK |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dropedIndex != null) return null |
|
|
|
return modifiedActions.map { this.currentRowRepresentables.indexOf(it) } |
|
|
|
return modifiedActions.map { this.currentRowRepresentables.indexOf(it) } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -199,12 +200,14 @@ class HHBuilder { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
/*** |
|
|
|
* Removes the actions, if necessary (those not automatically created), following an action change |
|
|
|
* Removes the actions, not the automatically created ones, |
|
|
|
|
|
|
|
* following an action change. |
|
|
|
* We want drop all non-auto added rows after the index |
|
|
|
* We want drop all non-auto added rows after the index |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun dropNextActionsIfNecessary(index: Int) { |
|
|
|
private fun dropNextActionsIfNecessary(index: Int) : Int? { |
|
|
|
// val dropIndex = index + 1 // TODO determine dropIndex |
|
|
|
// val dropIndex = index + 1 // TODO determine dropIndex |
|
|
|
// this.sortedActions = this.sortedActions.take(dropIndex) |
|
|
|
// this.sortedActions = this.sortedActions.take(dropIndex) |
|
|
|
|
|
|
|
return null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun remainingActivePlayerCountAtStreetStart(index: Int) : Int { |
|
|
|
private fun remainingActivePlayerCountAtStreetStart(index: Int) : Int { |
|
|
|
|