package app.furmeet.events.system.schedule.managers

import android.content.Context

object ScheduleManagerGetter {
    private lateinit var scheduleManager: ScheduleManager
    operator fun get(context: Context): ScheduleManager {
        if (ScheduleManagerGetter::scheduleManager.isInitialized.not())
            this[ScheduleManager(context)]
        else if (scheduleManager.hasFinished)
            this[ScheduleManager(context)]
        return scheduleManager
    }

    fun get(): ScheduleManager = scheduleManager
    operator fun get(new: ScheduleManager): ScheduleManager {
        scheduleManager = new
        return new
    }
}