parent
feb7ba5c1b
commit
1b486e0ae7
@ -0,0 +1,64 @@ |
||||
package net.pokeranalytics.android.calcul |
||||
|
||||
import net.pokeranalytics.android.R |
||||
import net.pokeranalytics.android.calculus.Calculator |
||||
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
||||
import net.pokeranalytics.android.ui.activity.ComparisonReportActivity |
||||
import net.pokeranalytics.android.ui.activity.ProgressReportActivity |
||||
import net.pokeranalytics.android.ui.activity.TableReportActivity |
||||
import net.pokeranalytics.android.ui.view.RowRepresentable |
||||
|
||||
/** |
||||
* The way the computed stats are going to be displayed |
||||
*/ |
||||
enum class ReportDisplay : RowRepresentable { |
||||
TABLE, |
||||
PROGRESS, |
||||
COMPARISON, |
||||
MAP; |
||||
|
||||
override val resId: Int? |
||||
get() { |
||||
return when (this) { |
||||
TABLE -> R.string.table |
||||
PROGRESS -> R.string.progress |
||||
COMPARISON -> R.string.comparison |
||||
MAP -> R.string.map |
||||
} |
||||
} |
||||
|
||||
val activityClass: Class<*> |
||||
get() { |
||||
return when (this) { |
||||
TABLE -> TableReportActivity::class.java |
||||
PROGRESS -> ProgressReportActivity::class.java |
||||
COMPARISON -> ComparisonReportActivity::class.java |
||||
else -> throw PAIllegalStateException("undefined activity for report display") |
||||
} |
||||
} |
||||
|
||||
val progressValues: Calculator.Options.ProgressValues |
||||
get() { |
||||
return when (this) { |
||||
PROGRESS, COMPARISON -> Calculator.Options.ProgressValues.STANDARD |
||||
else -> Calculator.Options.ProgressValues.NONE |
||||
} |
||||
} |
||||
|
||||
// val requireProgressValues: Boolean |
||||
// get() { |
||||
// return when (this) { |
||||
// PROGRESS, COMPARISON -> true |
||||
// else -> false |
||||
// } |
||||
// } |
||||
|
||||
val multipleStatSelection: Boolean |
||||
get() { |
||||
return when (this) { |
||||
PROGRESS -> false |
||||
else -> true |
||||
} |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue