import tooic.fatalityic.redic.speckledic.hankeringic.Farawayic
import tooic.fatalityic.redic.speckledic.hankeringic.Upholsteryic

object Goalkeeperic {

    private val TAG = "SpStringUtils"

    const val _KEY = ""

    fun getSpStringList(key: String): List<String> {
        val sp = Farawayic.getInstance().getString(key, "")
        return if (sp.equals("")) {
            listOf()
        } else {
            sp.split("|||")
        }
    }

    fun addSpString(key: String, value: String) {
        Upholsteryic.logDebug(TAG, "key=$key value=$value")
        val list = getSpStringList(key).toMutableList()
        list.add(value)
        val string = list.joinToString(separator = "|||")
        Farawayic.getInstance().put(key, string)
    }

    fun deleteSpString(key: String, value: String) {
        val list = getSpStringList(key).toMutableList()
        list.remove(value)
        val string = list.joinToString(separator = "|||")
        Farawayic.getInstance().put(key, string)
    }

}