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

import android.content.Context
import net.pokeranalytics.android.calculus.ComputedStat
import net.pokeranalytics.android.calculus.Stat
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.RowViewType


class StatRow(stat: Stat, computedStat: ComputedStat?, groupName: String = "", var title: String? = null) : RowRepresentable {

    var stat: Stat = stat
    var computedStat: ComputedStat? = computedStat
    var groupName: String = groupName

    override val viewType: Int
        get() = RowViewType.STATS.ordinal

    override val resId: Int?
        get() = this.stat.resId


    override fun localizedTitle(context: Context): String {

        this.title?.let {
            return it
        }
        this.resId?.let {
            return context.getString(it)
        }
        return "LOCALISATION NOT FOUND"
    }

}
