package net.pokeranalytics.android.model

import android.content.Context
import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.RowViewType

enum class TournamentType : RowRepresentable {
    MTT,
    SNG;

    companion object {
        val all : List<TournamentType>
            get() {
                return TournamentType.values() as List<TournamentType>
            }

        fun getValueForLabel(label: String) : TournamentType? {
            return when (label) {
                "Single-Table" -> SNG
                "Multi-Table" -> MTT
                else -> null
            }
        }
    }

    override val resId: Int?
        get() {
            return when (this) {
                MTT -> R.string.mtt
                SNG -> R.string.sng
            }
        }

    override fun getDisplayName(context: Context): String {
        return when (this) {
            MTT -> "MTT"
            SNG -> "SNG"
        }
    }

    override val viewType: Int = RowViewType.TITLE.ordinal
}