package com.atmob.keyboard_android.enums

import com.atmob.keyboard_android.R
import com.atmob.keyboard_android.ext.getResString

/**
 * 帮助模式枚举
 */
enum class HelpMode(val type: Int, val modeName: String) {
    /**
     * 帮聊
     */
    HELP_CHAT(1, getResString(R.string.mode_help_chat)),

    /**
     * 教你说
     */
    TEACH_YOU_SAY(1, getResString(R.string.mode_teach_you_say)),

    /**
     * 开场白
     */
    OPEN_REMARKS(2, getResString(R.string.mode_open_remarks));

    companion object {
        /**
         * 通过类型，找到枚举实例
         */
        fun fromType(type: Int): HelpMode {
            return values().firstOrNull {
                it.type == type
            } ?: HELP_CHAT
        }

        /**
         * 获取所有模式
         */
        fun getAll(): List<HelpMode> {
            return values().toList()
        }
    }
}