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

import android.content.Context
import net.pokeranalytics.android.calculus.ComputedStat
import net.pokeranalytics.android.model.interfaces.Identifiable
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.RowViewType

/**
 * A class to display a titleResId (and a value) as a Row Representable object
 */
class CustomizableRowRepresentable(
	var customViewType: RowViewType? = RowViewType.HEADER_TITLE,
	override var resId: Int? = null,
	var title: String? = null,
	var value: String? = null,
	var computedStat: ComputedStat? = null,
	var isSelectable: Boolean? = false
	) : RowRepresentable, Identifiable {

    override fun localizedTitle(context: Context): String {

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

    override val viewType: Int = customViewType?.ordinal ?: RowViewType.HEADER_TITLE.ordinal

	override var id: String = ""
}
