Shows player stack at hand start

hh
Laurent 5 years ago
parent 7156f00d82
commit f0787ab8ab
  1. 6
      app/src/main/java/net/pokeranalytics/android/ui/modules/feed/FeedFragment.kt
  2. 7
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt
  3. 53
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/ReplayerConfiguration.kt

@ -466,9 +466,9 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
*/ */
private fun createNewHandHistory() { private fun createNewHandHistory() {
// val intent = Intent(requireContext(), TestActivity::class.java) val intent = Intent(requireContext(), TestActivity::class.java)
// startActivity(intent) startActivity(intent)
// return return
AppGuard.endOfUse?.let { endDate -> AppGuard.endOfUse?.let { endDate ->

@ -727,7 +727,12 @@ class ActionList(var listener: ActionListListener? = null) : ArrayList<ComputedA
* Returns the player stack, located at the given [position], at the action [index] * Returns the player stack, located at the given [position], at the action [index]
*/ */
fun playerRemainingStack(position: Int, index: Int): Double? { fun playerRemainingStack(position: Int, index: Int): Double? {
return this.take(index + 1).lastOrNull { it.positionIndex == position }?.stackAfterActing val action = this.take(index + 1).lastOrNull { it.positionIndex == position }
return if (action != null) {
action.stackAfterActing
} else {
this.handHistory.playerSetupForPosition(position)?.stack
}
} }
/*** /***

@ -313,43 +313,40 @@ class ReplayerConfiguration(var handHistory: HandHistory) {
} }
} }
} }
fun stackRectForPlayer(i: Int): RectF { fun stackRectForPlayer(positionIndex: Int): RectF {
return this.playerStackRects[i] return this.playerStackRects[positionIndex]
} }
fun circleForPlayer(i: Int): Circle { fun circleForPlayer(positionIndex: Int): Circle {
return this.playerCircles[i] return this.playerCircles[positionIndex]
} }
fun chipCircle(i: Int): Circle { fun chipCircle(positionIndex: Int): Circle {
return this.chipCircles[i] return this.chipCircles[positionIndex]
} }
fun chipText(i: Int): TextPoint { fun chipText(positionIndex: Int): TextPoint {
return this.chipTextPoints[i] return this.chipTextPoints[positionIndex]
} }
fun pointForPlayerName(i: Int): TextPoint { fun pointForPlayerName(positionIndex: Int): TextPoint {
return this.playerNamePoints[i] return this.playerNamePoints[positionIndex]
} }
fun pointForPlayerStack(i: Int): TextPoint { fun pointForPlayerStack(positionIndex: Int): TextPoint {
return this.playerStackPoints[i] return this.playerStackPoints[positionIndex]
} }
fun pointForPlayerAction(i: Int): TextPoint { fun pointForPlayerAction(positionIndex: Int): TextPoint {
return this.playerActionPoints[i] return this.playerActionPoints[positionIndex]
} }
fun cardRects(i: Int): List<RectF> { fun cardRects(positionIndex: Int): List<RectF> {
return this.playerCardRects[i] return this.playerCardRects[positionIndex]
} }
fun lastActionBeforeStreet(street: Street): ComputedAction? { fun lastActionBeforeStreet(street: Street): ComputedAction? {
@ -406,16 +403,16 @@ class ReplayerConfiguration(var handHistory: HandHistory) {
return this.actionList.activePositionIndexes(index) return this.actionList.activePositionIndexes(index)
} }
fun playerRemainingStack(i: Int): Double? { fun playerRemainingStack(positionIndex: Int): Double? {
this.lastActionAtStep?.action?.index?.let { index -> this.lastActionAtStep?.action?.index?.let { index ->
return this.actionList.playerRemainingStack(i, index) return this.actionList.playerRemainingStack(positionIndex, index)
} }
return null return this.handHistory.playerSetupForPosition(positionIndex)?.stack
} }
fun lastChipCommittingActionOfPlayer(i: Int): ComputedAction? { fun lastChipCommittingActionOfPlayer(positionIndex: Int): ComputedAction? {
this.lastActionAtStep?.action?.index?.let { index -> this.lastActionAtStep?.action?.index?.let { index ->
return this.actionList.lastChipCommittingActionOfPlayer(i, index) return this.actionList.lastChipCommittingActionOfPlayer(positionIndex, index)
} }
return null return null
} }
@ -424,12 +421,12 @@ class ReplayerConfiguration(var handHistory: HandHistory) {
this.currentFrame += 1 this.currentFrame += 1
} }
fun animatedChipCircleFromPot(i: Int): Circle { fun animatedChipCircleFromPot(positionIndex: Int): Circle {
return this.animatedChipCircle(this.potChipCircle, this.chipCircle(i)) return this.animatedChipCircle(this.potChipCircle, this.chipCircle(positionIndex))
} }
fun animatedChipCircleToPot(i: Int): Circle { fun animatedChipCircleToPot(positionIndex: Int): Circle {
return this.animatedChipCircle(this.chipCircle(i), this.potChipCircle) return this.animatedChipCircle(this.chipCircle(positionIndex), this.potChipCircle)
} }
private fun animatedChipCircle(origin: Circle, destination: Circle): Circle { private fun animatedChipCircle(origin: Circle, destination: Circle): Circle {

Loading…
Cancel
Save