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

import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.RowViewType
import net.pokeranalytics.android.ui.view.rowrepresentable.FilterSectionRow.*

enum class FilterCategoryRow(override val resId: Int?, override val viewType: Int = RowViewType.TITLE_VALUE_ARROW.ordinal) : RowRepresentable {
	GENERAL(R.string.general),
	DATE(R.string.date),
	TIME_FRAME(R.string.duration),
	SESSIONS(R.string.sessions),
	CASH(R.string.cash),
	TOURNAMENT(R.string.tournament),
	ONLINE(R.string.online),
	RESULT(R.string.result),
	//TRANSACTION_TYPES(R.string.operation_types),
	LOCATIONS(R.string.locations),
	BANKROLLS(R.string.bankrolls),
	//PLAYERS(R.string.players),
	;

	val filterElements: List<RowRepresentable>
		get() {
			return filterSectionRows.flatMap {
				it.filterElements
			}
		}

	val filterSectionRows: List<FilterSectionRow>
		get() {
			return when (this) {
				GENERAL -> arrayListOf(
					CASH_TOURNAMENT,
					LIVE_ONLINE,
					GAME,
                    LIMIT_TYPE,
					TABLE_SIZE
				)
				DATE -> arrayListOf(
					DYNAMIC_DATE,
					FIXED_DATE,
					DURATION,
					YEAR,
					WEEKDAYS_OR_WEEKEND,
					DAY_OF_WEEK,
					MONTH_OF_YEAR
				)
				TIME_FRAME -> arrayListOf(
					SESSION_DURATION,
					TIME_FRAME_RANGE
				)
				SESSIONS -> arrayListOf(FilterSectionRow.SESSIONS)
				BANKROLLS -> arrayListOf(
					BANKROLL
				)
				CASH -> arrayListOf(
					BLIND
				)
				TOURNAMENT -> arrayListOf(
					TOURNAMENT_TYPE,
                    TOURNAMENT_NAME,
                    TOURNAMENT_FEATURE,
                    TOURNAMENT_ENTRY_FEE,
                    TOURNAMENT_NUMBER_OF_PLAYER,
                    TOURNAMENT_FINAL_POSITION
				)
				ONLINE -> arrayListOf(
					MULTI_TABLING
				)
				LOCATIONS -> arrayListOf(
					LOCATION
				)
                //PLAYERS -> arrayListOf(MULTI_PLAYER)
				RESULT -> arrayListOf(
					VALUE,
                    NUMBER_OF_REBUY
				)

				//TRANSACTION_TYPES -> arrayListOf()
			}
		}
}
