Fixes an issue where a call after an amountless bet would show a negative value

hh
Laurent 5 years ago
parent c8f8250484
commit a50f645cda
  1. 11
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt
  2. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt

@ -5,7 +5,6 @@ import net.pokeranalytics.android.model.handhistory.Position
import net.pokeranalytics.android.model.handhistory.Street
import net.pokeranalytics.android.model.realm.handhistory.Action
import net.pokeranalytics.android.model.realm.handhistory.HandHistory
import timber.log.Timber
interface ActionManager {
fun selectAction(index: Int, actionType: Action.Type)
@ -658,7 +657,7 @@ class ActionList(var listener: ActionListListener? = null) : ArrayList<ComputedA
}
/***
* Recomputes all remaining stacks for the given [positionIndexes], after the given [index]
* Recomputes all remaining stacks for the given [positionIndexes]
*/
fun updateRemainingStacksForPositions(positionIndexes: List<Int>) {
@ -703,14 +702,6 @@ class ActionList(var listener: ActionListListener? = null) : ArrayList<ComputedA
return firstStreetAction?.stackBeforeActing
}
/***
* Removes blinds for the list,
* used for the replayer/video export
*/
fun removeBlindActions() {
this.removeAll { it.action.type?.isBlind == true }
}
/***
* Returns the ComputedAction just before the passed [action]
*/

@ -248,7 +248,7 @@ class ComputedAction(var manager: ActionManager,
val significantAmount = significantAction.action.amount ?: 0.0
val committedAmount = getPreviouslyCommittedAmount()
this.action.effectiveAmount = significantAmount - committedAmount
this.action.effectiveAmount = max(significantAmount - committedAmount, 0.0)
}
fun getStreetLastSignificantAction(): ComputedAction? {

Loading…
Cancel
Save