package net.pokeranalytics.android.ui.fragment.components.bottomsheet

enum class BottomSheetType {
    NONE { override fun newInstance() = BottomSheetFragment()},
    LIST { override fun newInstance() = BottomSheetListFragment()},
    LIST_STATIC { override fun newInstance() = BottomSheetStaticListFragment()},
    LIST_GAME { override fun newInstance() = BottomSheetListGameFragment()},
    DOUBLE_LIST { override fun newInstance() = BottomSheetListGameFragment()},
    MULTI_SELECTION { override fun newInstance() = BottomSheetMultiSelectionFragment()},
    GRID { override fun newInstance() = BottomSheetTableSizeGridFragment()},
    EDIT_TEXT { override fun newInstance() = BottomSheetEditTextFragment()},
    EDIT_TEXT_MULTI_LINES { override fun newInstance() = BottomSheetEditTextMultiLinesFragment()},
    DOUBLE_EDIT_TEXT { override fun newInstance() = BottomSheetDoubleEditTextFragment()},
    SUM { override fun newInstance() = BottomSheetSumFragment()};

    abstract fun newInstance(): BottomSheetFragment

    val validationRequired : Boolean
        get() = when (this) {
            LIST, LIST_GAME, LIST_STATIC, GRID, DOUBLE_LIST -> false
            else -> true
        }

    val clearRequired : Boolean
        get() = true

    val addRequired : Boolean
        get() = when (this) {
            EDIT_TEXT, DOUBLE_EDIT_TEXT, EDIT_TEXT_MULTI_LINES, GRID, LIST_STATIC, SUM -> false
            else -> true
        }
}