Merge branch 'master' of gitlab.com:stax-river/poker-analytics

feature/top10
Aurelien Hubert 7 years ago
commit 0f5b15e32e
  1. 5
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -165,6 +165,7 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
var cgBigBlind: Double? = null var cgBigBlind: Double? = null
set(value) { set(value) {
this.hasBigBlind = if (value != null) 1 else 0 this.hasBigBlind = if (value != null) 1 else 0
field = value
} }
// Tournament // Tournament
@ -414,7 +415,7 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
fun getBlinds(): String { fun getBlinds(): String {
val currencyCode = bankroll?.currency?.code ?: Currency.getInstance(Locale.getDefault()).currencyCode val currencyCode = bankroll?.currency?.code ?: Currency.getInstance(Locale.getDefault()).currencyCode
val currencySymbol = Currency.getInstance(currencyCode).symbol val currencySymbol = Currency.getInstance(currencyCode).symbol
return if (cgSmallBlind == null) NULL_TEXT else "$currencySymbol ${cgSmallBlind?.formatted()}/${cgBigBlind?.formatted()}" return if (cgSmallBlind == null) NULL_TEXT else "$currencySymbol ${cgSmallBlind?.formatted()}/${cgBigBlind?.round()}"
} }
/** /**
@ -652,12 +653,12 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
when (row) { when (row) {
SessionRow.BANKROLL -> bankroll = value as Bankroll? SessionRow.BANKROLL -> bankroll = value as Bankroll?
SessionRow.BLINDS -> if (value is ArrayList<*>) { SessionRow.BLINDS -> if (value is ArrayList<*>) {
cgSmallBlind = try { cgSmallBlind = try {
(value[0] as String? ?: "0").toDouble() (value[0] as String? ?: "0").toDouble()
} catch (e: Exception) { } catch (e: Exception) {
null null
} }
cgBigBlind = try { cgBigBlind = try {
(value[1] as String? ?: "0").toDouble() (value[1] as String? ?: "0").toDouble()
} catch (e: Exception) { } catch (e: Exception) {

Loading…
Cancel
Save