package cn.yyxx.commsdk.core;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;

import java.util.List;

import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
import cn.yyxx.commsdk.base.internal.ICallback;
import cn.yyxx.commsdk.base.internal.IInitialize;
import cn.yyxx.commsdk.core.impl.SdkBridgeImpl;

/**
 * @author #Suyghur.
 * Created on 2021/12/25
 */
public final class SdkBridge {

    private SdkBridgeImpl impl = null;

    public SdkBridge(Context context) {
        if (null == impl) {
            impl = new SdkBridgeImpl(context);
        }
    }

    public void attachBaseContext(Application application, Context context) {
        impl.attachBaseContext(application, context);
    }

    public void initApplication(Application application) {
        impl.initApplication(application);
    }

    public void initAgreement(Activity activity, ICallback callback) {
        impl.initAgreement(activity, callback);
    }

    public void initialize(Activity activity, Boolean isLandscape, ICallback callback) {
        impl.initialize(activity, isLandscape, callback);
    }

    public void onFloatCenterLogout(Activity activity, ICallback callback) {
        impl.onFloatCenterLogout(activity, callback);
    }

    public void login(Activity activity, final ICallback callback) {
        impl.login(activity, callback);
    }

    public void logout(Activity activity, final ICallback callback) {
        impl.logout(activity, callback);
    }

    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
        impl.charge(activity, chargeInfo, callback);
    }

    public void roleCreate(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
        impl.roleCreate(activity, roleInfo, callback);
    }

    public void roleLauncher(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
        impl.roleLauncher(activity, roleInfo, callback);
    }

    public void roleUpgrade(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
        impl.roleUpgrade(activity, roleInfo, callback);
    }

    public boolean hasExitView(Activity activity) {
        return impl.hasExitView(activity);
    }

    public void openExitView(Activity activity, final ICallback callback) {
        impl.openExitView(activity, callback);
    }

    public void onStart(Activity activity) {
        impl.onStart(activity);
    }

    public void onRestart(Activity activity) {
        impl.onRestart(activity);
    }

    public void onResume(Activity activity) {
        impl.onResume(activity);
    }


    public void onPause(Activity activity) {
        impl.onPause(activity);
    }

    public void onStop(Activity activity) {
        impl.onStop(activity);
    }

    public void onDestroy(Activity activity) {
        impl.onDestroy(activity);
    }

    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) {
        impl.onActivityResult(activity, requestCode, resultCode, intent);
    }

    public void onNewIntent(Activity activity, Intent intent) {
        impl.onNewIntent(activity, intent);
    }

    public void requestPermission(Activity activity, List<String> permissions, ICallback callback) {
        impl.requestPermission(activity, permissions, callback);
    }

    public String getCurrentUserId() {
        return impl.getCurrentUserId();
    }
}
