Fixes an issue where a lost pot was considered a winner for hero if he had chips returned

realmasync
Laurent 2 years ago
parent b0d0a00f15
commit a1113903ea
  1. 10
      app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt

@ -477,7 +477,8 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable,
val heroWins: Boolean?
get() {
return this.heroIndex?.let { heroIndex ->
this.winnerPots.any { it.position == heroIndex }
heroIndex == this.largestWonPot?.position
// this.winnerPots.any { it.position == heroIndex }
} ?: run {
null
}
@ -733,7 +734,7 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable,
return boardHasWildCard || playerCardHasWildCard
}
val allFullCards: List<Card>
private val allFullCards: List<Card>
get() {
val cards = mutableListOf<Card>()
cards.addAll(this.board)
@ -753,4 +754,9 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable,
return cards.filter { it.isSuitWildCard }
}
val largestWonPot: WonPot?
get() {
return this.winnerPots.maxBy { it.amount }
}
}
Loading…
Cancel
Save