package com.gh.gamecenter

import android.content.Context
import com.kwai.monitor.log.TurboAgent
import com.kwai.monitor.log.TurboConfig

object KuaishouHelper {

    private val mAppId by lazy { BuildConfig.KUAI_SHOU_APP_ID.ifEmpty { "80655" } }
    private val mAppName by lazy { BuildConfig.KUAI_SHOU_APP_NAME.ifEmpty { "guanghuanzhushou_1" } }

    @JvmStatic
    fun init(context: Context, channel: String) {
        TurboAgent.init(
            TurboConfig.TurboConfigBuilder.create(context)
                .setAppId(mAppId)
                .setAppName(mAppName)
                .setAppChannel(channel)
                .build()
        )
    }

    @JvmStatic
    fun onEvent(type: String) {
        when (type) {
            "EVENT_ACTIVE" -> TurboAgent.onAppActive()
            "active_register" -> TurboAgent.onRegister()
            "EVENT_NEXTDAY_STAY" -> TurboAgent.onNextDayStay()
        }
    }
}