Removes chip distribution animation when the hand uses wildcards

hh
Laurent 5 years ago
parent 3279abcaff
commit c2da834a88
  1. 6
      app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Card.kt
  2. 7
      app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt
  3. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/ReplayerAnimator.kt

@ -9,7 +9,6 @@ import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.AppCompatTextView
import io.realm.RealmObject
import io.realm.annotations.Ignore
import net.pokeranalytics.android.R
import net.pokeranalytics.android.exceptions.PAIllegalStateException
import net.pokeranalytics.android.model.handhistory.Street
@ -241,4 +240,9 @@ open class Card : RealmObject() {
}
}
val isWildCard: Boolean
get() {
return this.value == null || this.suit == null || this.suit == Suit.UNDEFINED
}
}

@ -652,4 +652,11 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable,
return max
}
val usesWildcards: Boolean
get() {
val boardHasWildCard = this.cards.any { it.isWildCard }
val playerCardHasWildCard = this.playerSetups.any { it.cards.any { it.isWildCard } }
return boardHasWildCard || playerCardHasWildCard
}
}

@ -49,7 +49,7 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) {
this.frameManager.add(FrameType.GATHER_ANIMATION, framesForChipsAnimation)
}
// Chip distribution animation on the Summary
if (step == Street.SUMMARY) {
if (step == Street.SUMMARY && !this.handHistory.usesWildcards) {
this.frameManager.add(FrameType.DISTRIBUTION_ANIMATION, framesForChipsAnimation)
}
this.frameManager.add(FrameType.STATE, 1)

Loading…
Cancel
Save