package com.adealink.weparty.module.profile.data

enum class FollowStatus(val status: Int) {
    NONE(0b00), //无关注
    FOLLOW(0b01), //关注(我关注了ta)
    FANS(0b10), //粉丝(ta关注了我)
    EACH_FOLLOW(0b11); //互相关注

    companion object {
        @JvmStatic
        fun map(status: Int?): FollowStatus {
            status ?: return NONE
            return entries.find { it.status == status } ?: NONE
        }
    }
}

fun FollowStatus?.isFollowed(): Boolean {
    return this == FollowStatus.FOLLOW || this == FollowStatus.EACH_FOLLOW
}