|
|
|
|
@ -159,11 +159,15 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
when (config.frameType) { |
|
|
|
|
ReplayerConfiguration.FrameType.STATE -> { |
|
|
|
|
if (config.currentStep == Street.SUMMARY) { |
|
|
|
|
val amount = 666.0 |
|
|
|
|
val color = colorForAmount(amount) |
|
|
|
|
|
|
|
|
|
val winnerPots = config.handHistory.winnerPots.firstOrNull { it.position == i } |
|
|
|
|
winnerPots?.let { pot -> |
|
|
|
|
val color = colorForAmount(pot.amount) |
|
|
|
|
val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
drawChipCircle(circle, color, canvas, context) |
|
|
|
|
drawChipText(amount, config.chipText(i), canvas, context) |
|
|
|
|
drawChipText(pot.amount, config.chipText(i), canvas, context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ReplayerConfiguration.FrameType.GATHER_ANIMATION -> { |
|
|
|
|
@ -174,49 +178,19 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ReplayerConfiguration.FrameType.DISTRIBUTION_ANIMATION -> { |
|
|
|
|
val amount = 666.0 |
|
|
|
|
|
|
|
|
|
val color = colorForAmount(amount) |
|
|
|
|
val winnerPots = config.handHistory.winnerPots.firstOrNull { it.position == i } |
|
|
|
|
winnerPots?.let { pot -> |
|
|
|
|
val color = colorForAmount(pot.amount) |
|
|
|
|
val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
drawChipCircle(circle, color, canvas, context) |
|
|
|
|
|
|
|
|
|
// Timber.d("won pots = ${config.handHistory.winnerPots}") |
|
|
|
|
// val winnerPots = config.handHistory.winnerPots.firstOrNull { it.position == i } |
|
|
|
|
// winnerPots?.let { pot -> |
|
|
|
|
// val color = colorForAmount(pot.amount) |
|
|
|
|
// val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
// drawChipCircle(circle, color, canvas, context) |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
is ComputedAction -> { |
|
|
|
|
drawChipForAction(i, config, canvas, context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// is HandStep.GatherChips -> { |
|
|
|
|
// lastCommittedAmount(i, config)?.let { amount -> |
|
|
|
|
// val color = colorForAmount(amount) |
|
|
|
|
// val circle = config.animatedChipCircleToPot(i) |
|
|
|
|
// drawChipCircle(circle, color, canvas, context) |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// is HandStep.DistributeChips -> { |
|
|
|
|
// config.handHistory.winnerPots.firstOrNull { it.position == i }?.let { pot -> |
|
|
|
|
// val color = colorForAmount(pot.amount) |
|
|
|
|
// val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
// drawChipCircle(circle, color, canvas, context) |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// is Street -> { // animate chips |
|
|
|
|
// if (!config.isLastFrame) { |
|
|
|
|
// lastCommittedAmount(i, config)?.let { amount -> |
|
|
|
|
// val color = colorForAmount(amount) |
|
|
|
|
// val circle = config.animatedChipCircle(i) |
|
|
|
|
// drawChipCircle(circle, color, canvas, context) |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@ -346,11 +320,6 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// private fun drawPlayerPositionAndStack(action: ComputedAction, config: ReplayerConfiguration, canvas: Canvas, context: Context) { |
|
|
|
|
// drawPlayerRectangle(action.positionIndex,false, config, canvas, context) |
|
|
|
|
// drawPositionAndStack(action.positionIndex, action.stackAfterActing, config, canvas, context) |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
private fun drawPlayerCircle(i: Int, config: ReplayerConfiguration, canvas: Canvas, context: Context) { |
|
|
|
|
|
|
|
|
|
val playerSetup = config.handHistory.playerSetupForPosition(i) |
|
|
|
|
@ -451,9 +420,6 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
|
|
|
|
|
private fun drawBoardCards(street: Street, config: ReplayerConfiguration, canvas: Canvas, context: Context) { |
|
|
|
|
|
|
|
|
|
// when the step is the street, we wait for the last frame to display the board |
|
|
|
|
// if ((config.currentStep == street && config.isLastFrame) || config.currentStep != street) { |
|
|
|
|
// } |
|
|
|
|
val cards = config.handHistory.cardsForStreet(street) |
|
|
|
|
config.boardCardRects.take(street.totalBoardCards).forEachIndexed { index, rectF -> |
|
|
|
|
drawCard(cards[index], rectF, config, canvas, context) |
|
|
|
|
|