|
|
|
|
@ -36,7 +36,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 |
|
|
|
|
@ -251,10 +250,6 @@ open class Session : RealmObject(), Savable, RowRepresentable, Timed, |
|
|
|
|
* 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 |
|
|
|
|
@ -385,7 +380,6 @@ open class Session : RealmObject(), Savable, RowRepresentable, Timed, |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
this.computeNumberOfRebuy() |
|
|
|
|
// SessionManager.sessionNetChanged(this.session) |
|
|
|
|
this.computeNet(true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -857,7 +851,7 @@ open class Session : RealmObject(), Savable, RowRepresentable, Timed, |
|
|
|
|
return "Session ${this.creationDate}" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun updateValue(value: Any?, row: RowRepresentable, realm: Realm) { |
|
|
|
|
fun updateValue(value: Any?, row: RowRepresentable) { |
|
|
|
|
|
|
|
|
|
when (row) { |
|
|
|
|
SessionPropertiesRow.BANKROLL -> bankroll = value as Bankroll? |
|
|
|
|
@ -1106,7 +1100,7 @@ open class Session : RealmObject(), Savable, RowRepresentable, Timed, |
|
|
|
|
@Ignore |
|
|
|
|
override val realmObjectClass: Class<out Identifiable> = Session::class.java |
|
|
|
|
|
|
|
|
|
fun charSequenceForRow(row: RowRepresentable, context: Context): String { |
|
|
|
|
fun charSequenceForRow(row: RowRepresentable, context: Context, realm: Realm): String { |
|
|
|
|
|
|
|
|
|
return when (row) { |
|
|
|
|
SessionPropertiesRow.BANKROLL -> bankroll?.name ?: NULL_TEXT |
|
|
|
|
@ -1146,11 +1140,14 @@ open class Session : RealmObject(), Savable, RowRepresentable, Timed, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
SessionPropertiesRow.TOURNAMENT_NAME -> tournamentName?.name ?: NULL_TEXT |
|
|
|
|
SessionPropertiesRow.HANDS -> this.handHistories?.size.toString() |
|
|
|
|
SessionPropertiesRow.HANDS -> { |
|
|
|
|
val handHistories = realm.where(HandHistory::class.java).equalTo("session.id", this.id).findAll() |
|
|
|
|
handHistories.size.toString() |
|
|
|
|
} |
|
|
|
|
SessionPropertiesRow.HANDS_COUNT -> this.handsCountFormatted(context) |
|
|
|
|
SessionPropertiesRow.NUMBER_OF_TABLES -> this.numberOfTables.toString() |
|
|
|
|
is CustomField -> { |
|
|
|
|
Timber.d("entries count = ${customFieldEntries.size}") |
|
|
|
|
// Timber.d("entries count = ${customFieldEntries.size}") |
|
|
|
|
customFieldEntries.find { it.customField?.id == row.id }?.let { customFieldEntry -> |
|
|
|
|
return customFieldEntry.getFormattedValue(currency) |
|
|
|
|
} |
|
|
|
|
|