package net.taehui.twilight.system

import net.taehui.twilight.Logger
import net.taehui.twilight.Utility
import java.util.LinkedList
import java.util.concurrent.ConcurrentLinkedQueue

object QwilightNamesSystem : Logger {
    private val qwilightNames = LinkedList<String>()

    fun loadQwilightNames() {
        qwilightNames.addAll(DB.getQwilightNames())
        logInfo("Loaded Qwilight Names")
    }

    val qwilightName: String
        get() {
            return synchronized(qwilightNames) {
                val qwilightName = qwilightNames.poll() ?: ""
                if (qwilightName.isNotEmpty()) {
                    qwilightNames.offer(qwilightName)
                }
                qwilightName
            }
        }
}