|
|
|
|
@ -37,7 +37,6 @@ import net.pokeranalytics.android.util.extensions.hourMinute |
|
|
|
|
import net.pokeranalytics.android.util.extensions.shortDateTime |
|
|
|
|
import net.pokeranalytics.android.util.extensions.toCurrency |
|
|
|
|
import net.pokeranalytics.android.util.extensions.toMinutes |
|
|
|
|
import timber.log.Timber |
|
|
|
|
import java.text.DateFormat |
|
|
|
|
import java.text.NumberFormat |
|
|
|
|
import java.text.ParseException |
|
|
|
|
@ -216,7 +215,7 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
|
|
|
|
|
this.updateTimeParameter(field) |
|
|
|
|
this.computeNetDuration() |
|
|
|
|
// nullifies enddate when setting the start date after the end date |
|
|
|
|
// nullifies the endDate when setting the start date after the end date |
|
|
|
|
if (value != null && this.endDate != null && value.after(this.endDate)) { |
|
|
|
|
this.endDate = null |
|
|
|
|
} |
|
|
|
|
@ -264,10 +263,6 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
* The start date of the break |
|
|
|
|
*/ |
|
|
|
|
override var pauseDate: Date? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
// this.updateRowRepresentation() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The session set containing the sessions, which can contain multiple endedSessions |
|
|
|
|
var sessionSet: SessionSet? = null |
|
|
|
|
@ -326,9 +321,6 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
|
|
|
|
|
// The small blind value |
|
|
|
|
var cgOldSmallBlind: Double? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The big blind value |
|
|
|
|
var cgOldBigBlind: Double? = null |
|
|
|
|
@ -367,10 +359,6 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
|
|
|
|
|
// The entry fee of the tournament |
|
|
|
|
var tournamentEntryFee: Double? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
// this.result?.computeNumberOfRebuy() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The total number of players who participated in the tournament |
|
|
|
|
var tournamentNumberOfPlayers: Int? = null |
|
|
|
|
@ -389,10 +377,6 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
|
|
|
|
|
// The number of hands played during the sessions |
|
|
|
|
var handsCount: Int? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
// this.computeStats() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun bankrollHasBeenUpdated() { |
|
|
|
|
this.generateStakes() |
|
|
|
|
@ -690,7 +674,7 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Return the game titleResId |
|
|
|
|
* Example: NL Holdem |
|
|
|
|
* Example: NL Hold'em |
|
|
|
|
*/ |
|
|
|
|
fun getFormattedGame(): String { |
|
|
|
|
var gameTitle = "" |
|
|
|
|
@ -702,7 +686,7 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
if (game != null) { |
|
|
|
|
gameTitle += game?.name |
|
|
|
|
} |
|
|
|
|
return if (gameTitle.isNotBlank()) gameTitle else NULL_TEXT |
|
|
|
|
return gameTitle.ifBlank { NULL_TEXT } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun getFormattedStakes(): String { |
|
|
|
|
@ -793,7 +777,6 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
SessionPropertiesRow.CASHED_OUT, SessionPropertiesRow.PRIZE -> { |
|
|
|
|
val localResult = getOrCreateResult() |
|
|
|
|
localResult.cashout = value as Double? |
|
|
|
|
Timber.d("localResult cashout = ${localResult.cashout}") |
|
|
|
|
if (value != null) { |
|
|
|
|
this.end() |
|
|
|
|
} |
|
|
|
|
@ -869,7 +852,7 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim |
|
|
|
|
SessionPropertiesRow.NUMBER_OF_TABLES -> this.numberOfTables = (value as Double?)?.toInt() ?: 1 |
|
|
|
|
is CustomField -> { |
|
|
|
|
customFieldEntries.filter { it.customField?.id == row.id }.let { |
|
|
|
|
customFieldEntries.removeAll(it) |
|
|
|
|
customFieldEntries.removeAll(it.toSet()) |
|
|
|
|
} |
|
|
|
|
when (row.type) { |
|
|
|
|
CustomField.Type.AMOUNT.uniqueIdentifier, |
|
|
|
|
|