|
|
|
|
@ -257,7 +257,7 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
|
|
|
|
|
override fun getDisplayName(context: Context): String { |
|
|
|
|
val realm = Realm.getDefaultInstance() |
|
|
|
|
val entityName = entityName(realm) |
|
|
|
|
val entityName = entityName(realm, context) |
|
|
|
|
val completeLabel = when (listOfValues.size) { |
|
|
|
|
0 -> NULL_TEXT |
|
|
|
|
1, 2 -> { |
|
|
|
|
@ -269,8 +269,8 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
return completeLabel |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
open fun entityName(realm: Realm): String { |
|
|
|
|
return baseId |
|
|
|
|
open fun entityName(realm: Realm, context: Context): String { |
|
|
|
|
return entityName(context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun labelForValue(realm: Realm, value: String): String { |
|
|
|
|
@ -320,6 +320,10 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
constructor(bankroll: Bankroll) : this() { |
|
|
|
|
this.setObject(bankroll) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.bankrolls) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyGame() : QueryDataCondition<Game>() { |
|
|
|
|
@ -328,6 +332,10 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
constructor(game: Game) : this() { |
|
|
|
|
this.setObject(game) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.games) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyTournamentName() : QueryDataCondition<TournamentName>() { |
|
|
|
|
@ -336,6 +344,10 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
constructor(tournamentName: TournamentName) : this() { |
|
|
|
|
this.setObject(tournamentName) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.tournament_names) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyTournamentFeature() : QueryDataCondition<TournamentFeature>() { |
|
|
|
|
@ -344,6 +356,10 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
constructor(tournamentFeature: TournamentFeature) : this() { |
|
|
|
|
this.setObject(tournamentFeature) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.tournament_features) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AllTournamentFeature() : QueryDataCondition<TournamentFeature>() { |
|
|
|
|
@ -353,6 +369,10 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
constructor(tournamentFeature: TournamentFeature) : this() { |
|
|
|
|
this.setObject(tournamentFeature) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.tournament_features) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyLocation() : QueryDataCondition<Location>() { |
|
|
|
|
@ -361,6 +381,10 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
constructor(location: Location) : this() { |
|
|
|
|
this.setObject(location) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.locations) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyTransactionType() : QueryDataCondition<TransactionType>() { |
|
|
|
|
@ -369,27 +393,47 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
constructor(transactionType: TransactionType) : this() { |
|
|
|
|
this.setObject(transactionType) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.operation_types) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyLimit : ListOfInt() { |
|
|
|
|
override fun labelForValue(value: Int, context: Context): String { |
|
|
|
|
return Limit.values()[value].getDisplayName(context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.limits) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyTableSize : ListOfInt() { |
|
|
|
|
override fun labelForValue(value: Int, context: Context): String { |
|
|
|
|
return TableSize(value).getDisplayName(context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.table_sizes) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyTournamentType : ListOfInt() { |
|
|
|
|
override fun labelForValue(value: Int, context: Context): String { |
|
|
|
|
return TournamentType.values()[value].getDisplayName(context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.tournament_types) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class AnyBlind : ListOfString() |
|
|
|
|
class AnyBlind : ListOfString() { |
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|
return context.getString(R.string.blinds) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
object Last : SingleInt() { |
|
|
|
|
override var operator = Operator.EQUALS |
|
|
|
|
@ -649,7 +693,7 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
|
?: throw PokerAnalyticsException.QueryValueMapUnexpectedValue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun entityName(realm: Realm): String { |
|
|
|
|
override fun entityName(realm: Realm, context: Context): String { |
|
|
|
|
return customFieldName(realm) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|