|
|
|
|
@ -22,10 +22,11 @@ class ReplayerConfiguration(var handHistory: HandHistory) { |
|
|
|
|
private val maxCards = 5 |
|
|
|
|
|
|
|
|
|
var width = 100f |
|
|
|
|
val centerX: Float |
|
|
|
|
get() { return this.width / 2f } |
|
|
|
|
var height = 100f |
|
|
|
|
val centerY: Float |
|
|
|
|
|
|
|
|
|
private val centerX: Float |
|
|
|
|
get() { return this.width / 2f } |
|
|
|
|
private val centerY: Float |
|
|
|
|
get() { return this.height / 2f } |
|
|
|
|
|
|
|
|
|
var tableRect = RectF() |
|
|
|
|
@ -53,6 +54,7 @@ class ReplayerConfiguration(var handHistory: HandHistory) { |
|
|
|
|
|
|
|
|
|
private var playerItemsHeight = 10f |
|
|
|
|
private var playerItemsWidth = 10f |
|
|
|
|
var chipRadius = 10f |
|
|
|
|
private var paddingPercentage = 0.8f |
|
|
|
|
private var cardsPaddingPercentage = 0.9f |
|
|
|
|
|
|
|
|
|
@ -62,6 +64,10 @@ class ReplayerConfiguration(var handHistory: HandHistory) { |
|
|
|
|
val speed: Double = 1.0 |
|
|
|
|
val showVillainHands: Boolean = true |
|
|
|
|
|
|
|
|
|
var potTextPoint = TextPoint(0f, 0f, 0f) |
|
|
|
|
var totalPotTextPoint = TextPoint(0f, 0f, 0f) |
|
|
|
|
var potChipCircle = Circle(0f, 0f, 0f) |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
* Calculates the position of all elements to draw |
|
|
|
|
*/ |
|
|
|
|
@ -84,10 +90,11 @@ class ReplayerConfiguration(var handHistory: HandHistory) { |
|
|
|
|
|
|
|
|
|
// pz for Player Zone |
|
|
|
|
val pzHeight = height / playerPerColumn |
|
|
|
|
val pzWidth = width / playerPerRow |
|
|
|
|
// val pzWidth = width / playerPerRow |
|
|
|
|
|
|
|
|
|
this.playerItemsHeight = pzHeight / 3 |
|
|
|
|
this.playerItemsWidth = this.tableHPadding * 2 * this.paddingPercentage |
|
|
|
|
this.chipRadius = this.playerItemsHeight / 4 |
|
|
|
|
|
|
|
|
|
val cardWPaddingWidth = this.playerItemsWidth * 1.2f / this.maxCards |
|
|
|
|
val cardWidth = cardWPaddingWidth * this.cardsPaddingPercentage |
|
|
|
|
@ -104,6 +111,11 @@ class ReplayerConfiguration(var handHistory: HandHistory) { |
|
|
|
|
this.boardCardRects.add(RectF(bcLeft, bcTop, bcRight, bcBottom)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val chipTextSize = this.chipRadius |
|
|
|
|
this.potChipCircle = Circle(centerX, centerY - 5f * chipTextSize, this.chipRadius) |
|
|
|
|
this.potTextPoint = TextPoint(centerX, centerY - 3f * chipTextSize, chipTextSize) |
|
|
|
|
this.totalPotTextPoint = TextPoint(centerX, centerY - 2f * chipTextSize, chipTextSize) |
|
|
|
|
|
|
|
|
|
val playerCount = this.handHistory.numberOfPlayers |
|
|
|
|
// number of players in this order: bottom / left / top / right |
|
|
|
|
val repartition = when (playerCount) { |
|
|
|
|
@ -190,12 +202,10 @@ class ReplayerConfiguration(var handHistory: HandHistory) { |
|
|
|
|
val bottom = rectCenterY + this.playerItemsHeight / 2 |
|
|
|
|
this.playerStackRects.add(RectF(left, top, right, bottom)) |
|
|
|
|
|
|
|
|
|
val chipRadius = this.playerItemsHeight / 4 |
|
|
|
|
|
|
|
|
|
val chipCircleY = rectCenterY + chipYOffset - chipTextYOffsetCoef * chipRadius |
|
|
|
|
|
|
|
|
|
this.chipCircles.add(Circle(rectCenterX + chipXOffset, chipCircleY, chipRadius)) |
|
|
|
|
val chipTextSize = chipRadius |
|
|
|
|
|
|
|
|
|
this.chipTextPoints.add(TextPoint(rectCenterX + chipXOffset, chipCircleY + 2 * chipTextSize, chipTextSize)) |
|
|
|
|
|
|
|
|
|
|