|
|
|
@ -9,7 +9,9 @@ import io.realm.annotations.Ignore |
|
|
|
import io.realm.annotations.PrimaryKey |
|
|
|
import io.realm.annotations.PrimaryKey |
|
|
|
import io.realm.kotlin.where |
|
|
|
import io.realm.kotlin.where |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
|
|
|
import net.pokeranalytics.android.calculus.ComputedStat |
|
|
|
import net.pokeranalytics.android.calculus.SessionInterface |
|
|
|
import net.pokeranalytics.android.calculus.SessionInterface |
|
|
|
|
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
import net.pokeranalytics.android.model.Limit |
|
|
|
import net.pokeranalytics.android.model.Limit |
|
|
|
import net.pokeranalytics.android.model.LiveData |
|
|
|
import net.pokeranalytics.android.model.LiveData |
|
|
|
import net.pokeranalytics.android.model.TableSize |
|
|
|
import net.pokeranalytics.android.model.TableSize |
|
|
|
@ -345,14 +347,15 @@ open class Session : RealmObject(), SessionInterface, Savable, |
|
|
|
rows.add( |
|
|
|
rows.add( |
|
|
|
HeaderRowRepresentable( |
|
|
|
HeaderRowRepresentable( |
|
|
|
RowViewType.HEADER_TITLE_AMOUNT_BIG, |
|
|
|
RowViewType.HEADER_TITLE_AMOUNT_BIG, |
|
|
|
title = getDuration(), value = result?.net.toString() |
|
|
|
title = getDuration(), |
|
|
|
|
|
|
|
computedStat = ComputedStat(Stat.NETRESULT, result?.net ?: 0.0) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
rows.add( |
|
|
|
rows.add( |
|
|
|
HeaderRowRepresentable( |
|
|
|
HeaderRowRepresentable( |
|
|
|
RowViewType.HEADER_TITLE_AMOUNT, |
|
|
|
RowViewType.HEADER_TITLE_AMOUNT, |
|
|
|
resId = R.string.hour_rate_without_pauses, |
|
|
|
resId = R.string.hour_rate_without_pauses, |
|
|
|
value = this.sessionSet?.hourlyRate.toString() |
|
|
|
computedStat = ComputedStat(Stat.NETRESULT, this.sessionSet?.hourlyRate ?: 0.0) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
@ -361,7 +364,7 @@ open class Session : RealmObject(), SessionInterface, Savable, |
|
|
|
HeaderRowRepresentable( |
|
|
|
HeaderRowRepresentable( |
|
|
|
RowViewType.HEADER_TITLE_VALUE, |
|
|
|
RowViewType.HEADER_TITLE_VALUE, |
|
|
|
resId = R.string.bankroll_variation, |
|
|
|
resId = R.string.bankroll_variation, |
|
|
|
value = result?.net.toString() |
|
|
|
computedStat = ComputedStat(Stat.HOURLY_RATE, 0.0) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -389,13 +392,15 @@ open class Session : RealmObject(), SessionInterface, Savable, |
|
|
|
SessionRow.BUY_IN -> buyin.toCurrency() |
|
|
|
SessionRow.BUY_IN -> buyin.toCurrency() |
|
|
|
SessionRow.CASHED_OUT, SessionRow.PRIZE, SessionRow.NET_RESULT -> result?.cashout?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.CASHED_OUT, SessionRow.PRIZE, SessionRow.NET_RESULT -> result?.cashout?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.COMMENT -> if (comment.isNotEmpty()) comment else NULL_TEXT |
|
|
|
SessionRow.COMMENT -> if (comment.isNotEmpty()) comment else NULL_TEXT |
|
|
|
SessionRow.END_DATE -> if (timeFrame != null) timeFrame?.endDate?.shortDateTime() ?: NULL_TEXT else NULL_TEXT |
|
|
|
SessionRow.END_DATE -> if (timeFrame != null) timeFrame?.endDate?.shortDateTime() |
|
|
|
|
|
|
|
?: NULL_TEXT else NULL_TEXT |
|
|
|
SessionRow.GAME -> getGameTitle() |
|
|
|
SessionRow.GAME -> getGameTitle() |
|
|
|
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.LOCATION -> location?.name ?: NULL_TEXT |
|
|
|
SessionRow.LOCATION -> location?.name ?: NULL_TEXT |
|
|
|
SessionRow.PLAYERS -> tournamentNumberOfPlayers?.toString() ?: NULL_TEXT |
|
|
|
SessionRow.PLAYERS -> tournamentNumberOfPlayers?.toString() ?: NULL_TEXT |
|
|
|
SessionRow.POSITION -> result?.tournamentFinalPosition?.toString() ?: NULL_TEXT |
|
|
|
SessionRow.POSITION -> result?.tournamentFinalPosition?.toString() ?: NULL_TEXT |
|
|
|
SessionRow.START_DATE -> if (timeFrame != null) timeFrame?.startDate?.shortDateTime() ?: NULL_TEXT else NULL_TEXT |
|
|
|
SessionRow.START_DATE -> if (timeFrame != null) timeFrame?.startDate?.shortDateTime() |
|
|
|
|
|
|
|
?: NULL_TEXT else NULL_TEXT |
|
|
|
SessionRow.TABLE_SIZE -> this.tableSize?.let { TableSize(it).localizedTitle(context) } ?: NULL_TEXT |
|
|
|
SessionRow.TABLE_SIZE -> this.tableSize?.let { TableSize(it).localizedTitle(context) } ?: NULL_TEXT |
|
|
|
SessionRow.TIPS -> result?.tips?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.TIPS -> result?.tips?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.TOURNAMENT_TYPE -> tournamentType?.name ?: NULL_TEXT |
|
|
|
SessionRow.TOURNAMENT_TYPE -> tournamentType?.name ?: NULL_TEXT |
|
|
|
|