|
|
|
@ -9,7 +9,6 @@ import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
import net.pokeranalytics.android.model.filter.Query |
|
|
|
import net.pokeranalytics.android.model.filter.Query |
|
|
|
import net.pokeranalytics.android.model.filter.QueryCondition |
|
|
|
import net.pokeranalytics.android.model.filter.QueryCondition |
|
|
|
import net.pokeranalytics.android.model.interfaces.GraphIdentifiableEntry |
|
|
|
import net.pokeranalytics.android.model.interfaces.GraphIdentifiableEntry |
|
|
|
//import net.pokeranalytics.android.model.interfaces.Timed |
|
|
|
|
|
|
|
import net.pokeranalytics.android.model.realm.ComputableResult |
|
|
|
import net.pokeranalytics.android.model.realm.ComputableResult |
|
|
|
import net.pokeranalytics.android.model.realm.Filter |
|
|
|
import net.pokeranalytics.android.model.realm.Filter |
|
|
|
import net.pokeranalytics.android.model.realm.SessionSet |
|
|
|
import net.pokeranalytics.android.model.realm.SessionSet |
|
|
|
@ -178,8 +177,8 @@ class ComputableGroup(var query: Query, var stats: List<Stat>? = null) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class ComputedResults(group: ComputableGroup, shouldManageMultiGroupProgressValues: Boolean = false) : |
|
|
|
class ComputedResults(group: ComputableGroup, |
|
|
|
GraphUnderlyingEntry { |
|
|
|
shouldManageMultiGroupProgressValues: Boolean = false) : GraphUnderlyingEntry { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* The session group used to computed the statIds |
|
|
|
* The session group used to computed the statIds |
|
|
|
@ -194,9 +193,9 @@ class ComputedResults(group: ComputableGroup, shouldManageMultiGroupProgressValu |
|
|
|
|
|
|
|
|
|
|
|
private var shouldManageMultiGroupProgressValues = shouldManageMultiGroupProgressValues |
|
|
|
private var shouldManageMultiGroupProgressValues = shouldManageMultiGroupProgressValues |
|
|
|
|
|
|
|
|
|
|
|
fun allStats(): Collection<ComputedStat> { |
|
|
|
private val allStats: Collection<ComputedStat> |
|
|
|
return this._computedStats.values |
|
|
|
get() { return this._computedStats.values } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Adds a value to the evolution values |
|
|
|
* Adds a value to the evolution values |
|
|
|
@ -246,7 +245,7 @@ class ComputedResults(group: ComputableGroup, shouldManageMultiGroupProgressValu |
|
|
|
|
|
|
|
|
|
|
|
fun computeProgressValues(computedResults: ComputedResults) { |
|
|
|
fun computeProgressValues(computedResults: ComputedResults) { |
|
|
|
|
|
|
|
|
|
|
|
this.allStats().forEach { computedStat -> |
|
|
|
this.allStats.forEach { computedStat -> |
|
|
|
val stat = computedStat.stat |
|
|
|
val stat = computedStat.stat |
|
|
|
computedResults.computedStat(stat)?.let { previousComputedStat -> |
|
|
|
computedResults.computedStat(stat)?.let { previousComputedStat -> |
|
|
|
when (stat) { |
|
|
|
when (stat) { |
|
|
|
@ -281,7 +280,7 @@ class ComputedResults(group: ComputableGroup, shouldManageMultiGroupProgressValu |
|
|
|
val bbSessionCount = this.computedStat(Stat.BB_SESSION_COUNT)?.progressValue |
|
|
|
val bbSessionCount = this.computedStat(Stat.BB_SESSION_COUNT)?.progressValue |
|
|
|
val totalBuyin = this.computedStat(Stat.TOTAL_BUYIN)?.progressValue |
|
|
|
val totalBuyin = this.computedStat(Stat.TOTAL_BUYIN)?.progressValue |
|
|
|
|
|
|
|
|
|
|
|
this.allStats().forEach { computedStat -> |
|
|
|
this.allStats.forEach { computedStat -> |
|
|
|
when (computedStat.stat) { |
|
|
|
when (computedStat.stat) { |
|
|
|
Stat.HOURLY_RATE -> { |
|
|
|
Stat.HOURLY_RATE -> { |
|
|
|
if (netResult != null && duration != null) { |
|
|
|
if (netResult != null && duration != null) { |
|
|
|
|