Fixes bug where streets would not show up in text export

blinds
Laurent 4 years ago
parent 6b334da9b3
commit dc0840461b
  1. 15
      app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt

@ -329,26 +329,26 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable,
// Actions per street
val sortedActions = this.actions.sortedBy { it.index }
// val actionList = ActionList()
// actionList.load(this)
Street.values().forEach { street ->
// Remove SUMMARY
Street.values().dropLast(1).forEach { street ->
string = string.addLineReturn(2)
val streetActions = sortedActions.filter { it.street == street }.compact(positions, this.heroIndex)
if (streetActions.isNotEmpty()) {
val streetCards = this.cardsForStreet(street)
// we want to show streets: with actions or when an allin is called
if (streetCards.size == street.totalBoardCards || streetActions.isNotEmpty()) {
val streetItems = mutableListOf<CharSequence>(context.getString(street.resId))
val potSize = this.potSizeForStreet(street)
if (potSize > 0) {
// streetItems.add(context.getString(R.string.pot_size))
streetItems.add("(" + potSize.formatted + ")")
}
string = string.plus(streetItems.joinToString(" "))
val streetCards = this.cardsForStreet(street)
if (streetCards.isNotEmpty()) {
string = string.addLineReturn()
string = string.plus(streetCards.formatted(context) ?: "")
@ -362,6 +362,7 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable,
string = string.plus(localizedAction(action, context))
string = string.addLineReturn()
}
}
}

Loading…
Cancel
Save