|
|
|
|
@ -3,6 +3,7 @@ package net.pokeranalytics.android.model.realm |
|
|
|
|
import io.realm.* |
|
|
|
|
import io.realm.annotations.Ignore |
|
|
|
|
import io.realm.annotations.PrimaryKey |
|
|
|
|
import net.pokeranalytics.android.calculus.SessionInterface |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DisplayableDataSource |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowDelegate |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface |
|
|
|
|
@ -12,7 +13,7 @@ import java.util.* |
|
|
|
|
import kotlin.collections.ArrayList |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
open class Session(comment: String = "") : RealmObject(), DynamicRowDelegate, DisplayableDataSource { |
|
|
|
|
open class Session : RealmObject(), SessionInterface, DynamicRowDelegate, DisplayableDataSource { |
|
|
|
|
|
|
|
|
|
@PrimaryKey |
|
|
|
|
var id = UUID.randomUUID().toString() |
|
|
|
|
@ -24,7 +25,7 @@ open class Session(comment: String = "") : RealmObject(), DynamicRowDelegate, Di |
|
|
|
|
var timeFrame: TimeFrame? = null |
|
|
|
|
|
|
|
|
|
// The time frame sessionGroup, which can contain multiple sessions |
|
|
|
|
var sessionSet: SessionSet? = null |
|
|
|
|
override var sessionSet: SessionSet? = null |
|
|
|
|
|
|
|
|
|
// the date of creation of the app |
|
|
|
|
var creationDate: Date = Date() |
|
|
|
|
@ -83,20 +84,32 @@ open class Session(comment: String = "") : RealmObject(), DynamicRowDelegate, Di |
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
|
|
|
|
|
|
fun newInstance() : Session { |
|
|
|
|
fun newInstance(): Session { |
|
|
|
|
var session: Session = Session() |
|
|
|
|
session.result = Result() |
|
|
|
|
session.timeFrame = TimeFrame() |
|
|
|
|
return session |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun testInstance(netResult: Double): Session { |
|
|
|
|
var session: Session = Session.newInstance() |
|
|
|
|
session.result?.netResult = netResult |
|
|
|
|
return session |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Ignore // SessionInterface value |
|
|
|
|
override var value: Double = 0.0 |
|
|
|
|
get() { |
|
|
|
|
return this.result?.net ?: 0.0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Ignore |
|
|
|
|
var estimatedHands: Double = 0.0 |
|
|
|
|
override var estimatedHands: Double = 0.0 |
|
|
|
|
|
|
|
|
|
@Ignore |
|
|
|
|
var bbNetResult: Double = 0.0 |
|
|
|
|
override var bbNetResult: Double = 0.0 |
|
|
|
|
get() { |
|
|
|
|
this.cgBigBlind?.let { bb -> |
|
|
|
|
this.result?.let { result -> |
|
|
|
|
@ -107,10 +120,10 @@ open class Session(comment: String = "") : RealmObject(), DynamicRowDelegate, Di |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Ignore |
|
|
|
|
var bigBlindSessionCount: Int = if (this.cgBigBlind != null) 1 else 0 |
|
|
|
|
override var bigBlindSessionCount: Int = if (this.cgBigBlind != null) 1 else 0 |
|
|
|
|
|
|
|
|
|
@Ignore |
|
|
|
|
var buyin: Double = 0.0 |
|
|
|
|
override var buyin: Double = 0.0 |
|
|
|
|
get() { |
|
|
|
|
this.result?.let { |
|
|
|
|
it.buyin?.let { |
|
|
|
|
|