package com.gh.common.chain

import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import com.gh.common.dialog.PackageCheckDialogFragment
import com.gh.gamecenter.feature.entity.GameEntity

class PackageCheckHandler : ChainHandler() {

    override fun handleRequest(context: Context, gameEntity: GameEntity) {
        PackageCheckDialogFragment.show((context as AppCompatActivity), gameEntity) {
            if (hasNext()) {
                getNext()?.handleRequest(context, gameEntity)
            } else {
                processEndCallback?.invoke(null)
            }
        }
    }
}