package com.adealink.weparty.module.wallet.data

import com.adealink.frame.aab.util.getCompatString
import com.adealink.weparty.R


enum class Currency(val type: Int) {
    COIN(0),
    DIAMOND(1),
    BEAN(2);


    fun desc(): String {
        return when (this) {
            BEAN -> {
                getCompatString(R.string.common_bean)
            }

            COIN -> {
                getCompatString(R.string.common_coin)
            }

            DIAMOND -> {
                getCompatString(R.string.common_diamond)
            }
        }
    }

    companion object {
        @JvmStatic
        fun map(currency: Int?): Currency? {
            currency ?: return null
            return entries.find { it.type == currency }
        }
    }
}