package net.pokeranalytics.android.ui.view.rowrepresentable

import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.Criteria
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.RowViewType

/**
 * An enum managing the report rows
 */
enum class ReportRow : RowRepresentable {
	BLINDS,
	BUY_IN,
	DAY_OF_WEEKS,
	GENERAL,
	LOCATIONS,
	//NUMBER_OF_TABLES,
	TOURNAMENT_TYPES,
	GAME;


	companion object {
		/**
		 * Return the report rows
		 */
		fun getRows(): ArrayList<RowRepresentable> {
			val rows = ArrayList<RowRepresentable>()
			rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.comparison))
			rows.addAll(values())
			return rows
		}
	}

	override val resId: Int?
		get() {
			return when (this) {
				BLINDS -> R.string.blinds
				BUY_IN -> R.string.buyin
				DAY_OF_WEEKS -> R.string.day_of_the_week
				GENERAL -> R.string.general
				LOCATIONS -> R.string.locations
				//NUMBER_OF_TABLES -> R.string.number_of_tables
				TOURNAMENT_TYPES -> R.string.tournament_type_complete
				GAME -> R.string.game
			}
		}

	override val viewType: Int = RowViewType.TITLE_ARROW.ordinal

	val criteria: List<Criteria>
		get() {
			return when (this) {
				BLINDS -> listOf(Criteria.Blinds)
				BUY_IN -> listOf(Criteria.TournamentFees)
				DAY_OF_WEEKS -> listOf(Criteria.DaysOfWeek)
				GENERAL -> listOf(Criteria.SessionTypes, Criteria.BankrollTypes)
				LOCATIONS -> listOf(Criteria.Locations)
				//NUMBER_OF_TABLES -> listOf() //TODO
				TOURNAMENT_TYPES -> listOf(Criteria.TournamentTypes)
				GAME -> listOf(Criteria.Games)
			}
		}

}