|
|
|
|
@ -14,7 +14,7 @@ import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
|
|
|
|
|
|
class TableDrawer { |
|
|
|
|
|
|
|
|
|
lateinit var animator: ReplayerAnimator |
|
|
|
|
private lateinit var animator: ReplayerAnimator |
|
|
|
|
|
|
|
|
|
private val backgroundColor = R.color.green_darker |
|
|
|
|
private val backgroundPaint = Paint() |
|
|
|
|
@ -151,7 +151,7 @@ class TableDrawer { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
FrameType.GATHER_ANIMATION -> { |
|
|
|
|
lastCommittedAmount(i)?.let { amount -> |
|
|
|
|
animator.lastCommittedAmount(i)?.let { amount -> |
|
|
|
|
val color = colorForAmount(amount) |
|
|
|
|
val circle = animator.animatedChipCircleToPot(i) |
|
|
|
|
drawChipCircle(circle, color, canvas, context) |
|
|
|
|
@ -176,19 +176,11 @@ class TableDrawer { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun drawChipForAction(i: Int, canvas: Canvas, context: Context) { |
|
|
|
|
lastCommittedAmount(i)?.let { amount -> |
|
|
|
|
animator.lastCommittedAmount(i)?.let { amount -> |
|
|
|
|
drawChip(amount, i, canvas, context) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun lastCommittedAmount(i: Int): Double? { |
|
|
|
|
var committingAction = animator.lastChipCommittingActionOfPlayer(i) |
|
|
|
|
if (committingAction?.action?.type?.isCall == true) { |
|
|
|
|
committingAction = committingAction.getStreetLastSignificantAction() |
|
|
|
|
} |
|
|
|
|
return committingAction?.action?.amount |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
* WARNING: Avoid instancing objects here, as it's called from onDraw method |
|
|
|
|
*/ |
|
|
|
|
|