package com.gh.common.chain

import android.content.Context
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.feature.entity.GameEntity

class UnsupportedFeatureHandler : DownloadChainHandler() {

    override fun handleRequest(
        context: Context,
        gameEntity: GameEntity,
        asVGame: Boolean
    ) {
        if (shouldShowUnsupportedFeatureDialog()) {
            DialogHelper.showUnsupportedFeatureDialog(context)
        } else {
            if (hasNext()) {
                getNext()?.handleRequest(context, gameEntity, asVGame)
            } else {
                processEndCallback?.invoke(asVGame, null)
            }
        }
    }

    /**
     * TODO 检查某个版本是否支持指定的功能
     */
    private fun shouldShowUnsupportedFeatureDialog(): Boolean = false
}