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

feature/top10
Laurent 7 years ago
commit 3a5572c3e6
  1. 5
      app/src/main/java/net/pokeranalytics/android/model/migrations/PokerAnalyticsMigration.kt
  2. 8
      app/src/main/java/net/pokeranalytics/android/model/realm/Result.kt

@ -3,6 +3,7 @@ package net.pokeranalytics.android.model.migrations
import io.realm.DynamicRealm import io.realm.DynamicRealm
import io.realm.RealmMigration import io.realm.RealmMigration
import timber.log.Timber import timber.log.Timber
import java.util.*
class PokerAnalyticsMigration : RealmMigration { class PokerAnalyticsMigration : RealmMigration {
@ -58,6 +59,10 @@ class PokerAnalyticsMigration : RealmMigration {
schema.get("FilterCondition")?.let { schema.get("FilterCondition")?.let {
it.removeField("blindValues") it.removeField("blindValues")
it.addField("operator", String::class.java).setNullable("operator", true)
it.addField("intValue", Int::class.java).setNullable("intValue", true)
it.addField("doubleValue", Double::class.java).setNullable("intValue", true)
it.addField("stringValue", String::class.java).setNullable("stringValue", true)
} }
schema.get("ComputableResult")?.let { schema.get("ComputableResult")?.let {

@ -28,6 +28,7 @@ open class Result : RealmObject(), Filterable {
var buyin: Double? = null var buyin: Double? = null
set(value) { set(value) {
field = value field = value
this.computeNumberOfRebuy()
this.computeNet() this.computeNet()
} }
@ -85,6 +86,9 @@ open class Result : RealmObject(), Filterable {
// The tournament final position, if applicable // The tournament final position, if applicable
var tournamentFinalPosition: Int? = null var tournamentFinalPosition: Int? = null
// Number of rebuys
//var numberOfRebuy: Double? = null
@LinkingObjects("result") @LinkingObjects("result")
private val sessions: RealmResults<Session>? = null private val sessions: RealmResults<Session>? = null
@ -117,6 +121,10 @@ open class Result : RealmObject(), Filterable {
this.session?.sessionSet?.computeStats() this.session?.sessionSet?.computeStats()
} }
// Computes the number of rebuy
private fun computeNumberOfRebuy() {
}
// @todo tips? // @todo tips?
} }
Loading…
Cancel
Save