|
|
|
|
@ -12,11 +12,11 @@ import kotlinx.coroutines.GlobalScope |
|
|
|
|
import kotlinx.coroutines.async |
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.calculus.calcul.ReportDisplay |
|
|
|
|
import net.pokeranalytics.android.calculus.Calculator |
|
|
|
|
import net.pokeranalytics.android.calculus.ComputableGroup |
|
|
|
|
import net.pokeranalytics.android.calculus.Report |
|
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
|
import net.pokeranalytics.android.calculus.calcul.ReportDisplay |
|
|
|
|
import net.pokeranalytics.android.databinding.FragmentComposableTableReportBinding |
|
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.ui.activity.components.ReportActivity |
|
|
|
|
@ -156,25 +156,17 @@ open class ComposableTableReportFragment : RealmFragment(), StaticRowRepresentab |
|
|
|
|
private fun convertReportIntoRepresentables(report: Report): ArrayList<RowRepresentable> { |
|
|
|
|
|
|
|
|
|
val rows: ArrayList<RowRepresentable> = ArrayList() |
|
|
|
|
report.results.forEach { result -> |
|
|
|
|
val title = result.group.query.getName(requireContext()).capitalize() |
|
|
|
|
rows.add(CustomizableRowRepresentable(title = title)) |
|
|
|
|
val statList = result.group.displayedStats ?: report.options.stats |
|
|
|
|
statList.forEach { stat -> |
|
|
|
|
rows.add(StatRow(stat, result.computedStat(stat), result.group.query.getName(requireContext()))) |
|
|
|
|
this.context?.let { context -> |
|
|
|
|
report.results.forEach { result -> |
|
|
|
|
val title = result.group.query.getName(context).capitalize() |
|
|
|
|
rows.add(CustomizableRowRepresentable(title = title)) |
|
|
|
|
val statList = result.group.displayedStats ?: report.options.stats |
|
|
|
|
statList.forEach { stat -> |
|
|
|
|
rows.add(StatRow(stat, result.computedStat(stat), result.group.query.getName(context))) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return rows |
|
|
|
|
|
|
|
|
|
// val rows: ArrayList<RowRepresentable> = ArrayList() |
|
|
|
|
// report.options.stats.forEach {stat -> |
|
|
|
|
// rows.add(CustomizableRowRepresentable(title = stat.localizedTitle(requireContext()))) |
|
|
|
|
// report.results.forEach { |
|
|
|
|
// val title = it.group.name |
|
|
|
|
// rows.add(StatRow(stat, it.computedStat(stat), it.group.name, title)) |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// return rows |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// RowRepresentableDelegate |
|
|
|
|
|