|
|
|
|
@ -87,7 +87,7 @@ open class Result : RealmObject(), Filterable { |
|
|
|
|
var tournamentFinalPosition: Int? = null |
|
|
|
|
|
|
|
|
|
// Number of rebuys |
|
|
|
|
//var numberOfRebuy: Double? = null |
|
|
|
|
var numberOfRebuy: Double? = null |
|
|
|
|
|
|
|
|
|
@LinkingObjects("result") |
|
|
|
|
private val sessions: RealmResults<Session>? = null |
|
|
|
|
@ -123,6 +123,25 @@ open class Result : RealmObject(), Filterable { |
|
|
|
|
|
|
|
|
|
// Computes the number of rebuy |
|
|
|
|
private fun computeNumberOfRebuy() { |
|
|
|
|
this.session?.let { |
|
|
|
|
if (it.isCashGame()) { |
|
|
|
|
it.cgBigBlind?.let { bb -> |
|
|
|
|
if (bb > 0.0) { |
|
|
|
|
this.numberOfRebuy = (this.buyin ?: 0.0) / bb |
|
|
|
|
} else { |
|
|
|
|
this.numberOfRebuy = null |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
it.tournamentEntryFee?.let { entryFee -> |
|
|
|
|
if (entryFee > 0.0) { |
|
|
|
|
this.numberOfRebuy = (this.buyin ?: 0.0) / entryFee |
|
|
|
|
} else { |
|
|
|
|
this.numberOfRebuy = null |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @todo tips? |
|
|
|
|
|