package com.rgt.superr.business.ads


abstract class AdsShowCallBack {


    var adShowed: Boolean = false
    var nextCalled: Boolean = false

    //展示广告时调用
    open fun show() {
        adShowed = true
    }

    //流程中非广告的失败时调用
    open fun failed(where: Int = 0) {
        adShowed = false
        if (!nextCalled) {
            nextCalled = true
            next()
        }
    }

    //流程中广告本身时调用
    open fun adFailed(where: Int = 0) {
        adShowed = false
        if (!nextCalled) {
            nextCalled = true
            next()
        }
    }

    //用户手动关闭广告时调用
    open fun close(where: Int = 0) {
        if (!nextCalled) {
            nextCalled = true
            next()
        }
    }

    abstract fun next()

}