package com.adealink.weparty.room.member.data

import com.adealink.weparty.commonui.recycleview.diffutil.BaseListItemData
import com.adealink.weparty.module.playmate.data.PlaymateCategoryData
import com.adealink.weparty.module.profile.data.UserPlaymateSkill
import com.adealink.weparty.ui.category.data.CategoryListItemData


sealed class BasePlaymateCategoryItem : BaseListItemData

data class MemberPlaymateCategoryItemData(
    val skill: UserPlaymateSkill
) : BasePlaymateCategoryItem() {
    override fun areContentsTheSame(newItem: Any): Boolean {
        val other = (newItem as? MemberPlaymateCategoryItemData) ?: return false
        return skill.id == other.skill.id
    }
}

data class PlaymateCategoryItemData(
    val skill: PlaymateCategoryData
) : BasePlaymateCategoryItem() {
    var selected: Boolean = false

    override fun areContentsTheSame(newItem: Any): Boolean {
        val other = (newItem as? PlaymateCategoryItemData) ?: return false
        return skill.code == other.skill.code
                && selected == other.selected
    }
}

class PlaymateCategoryAllItemData : BasePlaymateCategoryItem() {
    var selected: Boolean = false

    override fun areContentsTheSame(newItem: Any): Boolean {
        val other = (newItem as? PlaymateCategoryAllItemData) ?: return false
        return selected == other.selected
    }
}