package com.remax.visualnovel.app.initializer.impl

import android.app.Application
import com.remax.visualnovel.app.initializer.AppInitializers
import com.remax.visualnovel.app.initializer.di.AppInitializerPriority
import com.remax.visualnovel.utils.datastore.IDataStoreOwner
import com.tencent.mmkv.MMKV

/**
 * Created by HJW on 2023/5/11
 * 本地数据保存相关初始化
 */
class LocalDataInitializer(val application: Application) : AppInitializers {

    override fun init() {
        //初始化mmkv
        val dir = application.filesDir.absolutePath + "/mmkv_epal"
        MMKV.initialize(application, dir)
        //初始化datastore
        IDataStoreOwner.application = application
    }

    override fun widget(): Int {
        return AppInitializerPriority.SERIES_3.priority
    }

}