package com.adealink.weparty.module.playmate

import androidx.lifecycle.ViewModelStoreOwner
import com.adealink.frame.aab.BaseDynamicModule
import com.adealink.weparty.R
import com.adealink.weparty.module.playmate.viewmodel.IPlaymateViewModel

object PlaymateModule : BaseDynamicModule<IPlaymateService>(IPlaymateService::class),
    IPlaymateService {

    override val featureName: String
        get() = "playmate"

    override val moduleNameResId: Int
        get() = R.string.module_playmate

    override fun emptyService(): IPlaymateService {
        return object : IPlaymateService {

            override fun getService(): IPlaymateService? {
                return null
            }

            override fun getPlaymateViewModel(owner: ViewModelStoreOwner): IPlaymateViewModel? {
                return null
            }

            override fun logout() {
            }
        }
    }

    override fun getPlaymateViewModel(owner: ViewModelStoreOwner): IPlaymateViewModel? {
        return getService().getPlaymateViewModel(owner)
    }

    override fun logout() {
        getService().logout()
    }
}