|
|
|
|
@ -5,8 +5,8 @@ import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Action |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.HandRowType |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.StreetCardHeader |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable |
|
|
|
|
import timber.log.Timber |
|
|
|
|
import java.util.* |
|
|
|
|
@ -146,8 +146,9 @@ class HHBuilder { |
|
|
|
|
* If the user changes the current action, |
|
|
|
|
* for convenience we remove all the following actions to avoid managing complex cases |
|
|
|
|
* Also calculates the player effective amounts in proper cases |
|
|
|
|
* Returns the list of modified action indexes that are not the action at [index] |
|
|
|
|
*/ |
|
|
|
|
fun selectAction(index: Int, actionType: Action.Type) : Boolean { |
|
|
|
|
fun selectAction(index: Int, actionType: Action.Type) : List<Int> { |
|
|
|
|
|
|
|
|
|
Timber.d(">>> Sets $actionType at index: $index") |
|
|
|
|
|
|
|
|
|
@ -160,8 +161,9 @@ class HHBuilder { |
|
|
|
|
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 |
|
|
|
|
@ -188,7 +190,7 @@ class HHBuilder { |
|
|
|
|
else -> {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return computedAction.requiresAmount |
|
|
|
|
return modifiedActions.map { this.currentRowRepresentables.indexOf(it) } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun getPreviousEmptyActions(index: Int) : List<ComputedAction> { |
|
|
|
|
|