diff --git a/app/src/main/java/net/pokeranalytics/android/model/handhistory/Street.kt b/app/src/main/java/net/pokeranalytics/android/model/handhistory/Street.kt index ca2bf3cc..2b49c7c3 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/handhistory/Street.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/handhistory/Street.kt @@ -1,10 +1,7 @@ package net.pokeranalytics.android.model.handhistory -import android.content.Context -import android.graphics.Canvas import net.pokeranalytics.android.R import net.pokeranalytics.android.ui.modules.handhistory.replayer.HandStep -import net.pokeranalytics.android.ui.modules.handhistory.replayer.ReplayerAnimator enum class Street : HandStep { PREFLOP, @@ -49,18 +46,5 @@ enum class Street : HandStep { } } -// override fun draw(configuration: ReplayerConfiguration, canvas: Canvas, context: Context) { -// TableDrawer.drawStreet(this, configuration, canvas, context) -// } - - override fun frames( - animator: ReplayerAnimator, - canvas: Canvas, - context: Context, - update: () -> Unit - ) { -// TableDrawer.drawStreet(this, configuration, canvas, context) - } - } diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt index e09e533d..16636257 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt @@ -9,8 +9,6 @@ import net.pokeranalytics.android.ui.modules.handhistory.model.ActionReadRow import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType import net.pokeranalytics.android.util.extensions.formatted -import timber.log.Timber -import java.text.FieldPosition /*** diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt index 0436355c..7349a728 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt @@ -1,7 +1,5 @@ package net.pokeranalytics.android.ui.modules.handhistory.model -import android.content.Context -import android.graphics.Canvas import net.pokeranalytics.android.exceptions.PAIllegalStateException import net.pokeranalytics.android.model.handhistory.Position import net.pokeranalytics.android.model.handhistory.Street @@ -10,7 +8,7 @@ import net.pokeranalytics.android.model.realm.handhistory.HandHistory import net.pokeranalytics.android.model.realm.handhistory.toReadRow import net.pokeranalytics.android.ui.modules.handhistory.HandRowType import net.pokeranalytics.android.ui.modules.handhistory.replayer.HandStep -import net.pokeranalytics.android.ui.modules.handhistory.replayer.ReplayerAnimator +import timber.log.Timber import kotlin.math.max /*** @@ -188,27 +186,6 @@ class ComputedAction(var manager: ActionManager, } - /*** - * Sets the effective amount of the action - * Also calculates the player remaining stack if possible - */ -// private fun setEffectiveAmount(amount: Double) { -// this.action.effectiveAmount = amount -// -// val oldEffective = this.action.effectiveAmount -// -// this.stackBeforeActing?.let { -// -// val oldPlayerRemainingStack = it + oldEffective -// val revisedAmount = min(amount, oldPlayerRemainingStack) -// val remainingStack = it - revisedAmount + oldEffective -// this.stackBeforeActing = remainingStack -// -// this.action.toggleType(remainingStack) -// -// } -// } - override fun isFieldNeedsInput(tag: Int, handHistory: HandHistory): Boolean { return when (tag) { Tag.ACTION.ordinal -> this.action.type == null @@ -248,7 +225,13 @@ class ComputedAction(var manager: ActionManager, val significantAmount = significantAction.action.amount ?: 0.0 val committedAmount = getPreviouslyCommittedAmount() - this.action.effectiveAmount = max(significantAmount - committedAmount, 0.0) + val effectiveAmount = significantAmount - committedAmount + this.action.effectiveAmount = if (effectiveAmount >= 0) { + effectiveAmount + } else { + Timber.w("Putting 0.0 as effectiveAmount in the action instead of the calculated: $effectiveAmount") + 0.0 + } } fun getStreetLastSignificantAction(): ComputedAction? { @@ -307,22 +290,4 @@ class ComputedAction(var manager: ActionManager, override val positionIndex: Int get() { return this.action.position } - val previousAction: ComputedAction? - get() { - return this.manager.previousAction(this) - } - -// override fun draw(configuration: ReplayerConfiguration, canvas: Canvas, context: Context) { -// TableDrawer.drawAction(this, true, configuration, canvas, context) -// } - - override fun frames( - animator: ReplayerAnimator, - canvas: Canvas, - context: Context, - update: () -> Unit - ) { -// TODO("Not yet implemented") - } - } \ No newline at end of file diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/HandStep.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/HandStep.kt index b08ea015..dc173d19 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/HandStep.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/HandStep.kt @@ -11,8 +11,6 @@ interface HandStep { val street: Street - fun frames(animator: ReplayerAnimator, canvas: Canvas, context: Context, update: () -> (Unit)) - companion object { fun createSteps(handHistory: HandHistory): List {