|
|
|
|
@ -1,8 +1,7 @@ |
|
|
|
|
package net.pokeranalytics.android.model.filter |
|
|
|
|
|
|
|
|
|
import android.content.Context |
|
|
|
|
import io.realm.RealmQuery |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import io.realm.kotlin.where |
|
|
|
|
|
|
|
|
|
fun List<Query>.mapFirstCondition() : List<QueryCondition> { |
|
|
|
|
return this.map { it.conditions.first() } |
|
|
|
|
@ -67,15 +66,11 @@ class Query { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val queryLastGame = this.conditions.filter { |
|
|
|
|
it is QueryCondition.LastGame |
|
|
|
|
val queryLast = this.conditions.filter { |
|
|
|
|
it is QueryCondition.Last |
|
|
|
|
}.firstOrNull() |
|
|
|
|
val queryLastSession = this.conditions.filter { |
|
|
|
|
it is QueryCondition.LastSession |
|
|
|
|
}.firstOrNull() |
|
|
|
|
|
|
|
|
|
queryLastGame?.let { |
|
|
|
|
|
|
|
|
|
queryLast?.let { |
|
|
|
|
return realmQuery.limit((it as QueryCondition.Last).singleValue.toLong()) |
|
|
|
|
} |
|
|
|
|
return realmQuery |
|
|
|
|
} |
|
|
|
|
|