24 lines
511 B
Kotlin
24 lines
511 B
Kotlin
package com.gh.common.chain
|
|
|
|
import android.content.Context
|
|
import com.gh.gamecenter.feature.entity.GameEntity
|
|
|
|
abstract class ChainHandler {
|
|
private var next: ChainHandler? = null
|
|
var processEndCallback: ((Any?) -> Unit)? = null
|
|
|
|
fun setNext(next: ChainHandler?) {
|
|
this.next = next
|
|
}
|
|
|
|
fun getNext(): ChainHandler? {
|
|
return next
|
|
}
|
|
|
|
fun hasNext(): Boolean {
|
|
return next != null
|
|
}
|
|
|
|
abstract fun handleRequest(context: Context, gameEntity: GameEntity)
|
|
|
|
} |