package com.gh.common.chain

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

class GamePermissionHandler : ChainHandler() {

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