package com.pixelized.desktop.lwa.repository.tag

import com.pixelized.shared.lwa.model.tag.Tag
import kotlinx.coroutines.flow.StateFlow

class TagRepository(
    private val store: TagStore,
) {
    suspend fun updateCharacterTags() = store.updateCharacterTagsFlow()

    suspend fun updateAlterationTags() = store.updateAlterationTagsFlow()

    suspend fun updateItemTags() = store.updateItemTagsFlow()

    fun charactersTagFlow(): StateFlow<Map<String, Tag>> = store.charactersTagFlow()

    fun charactersTags(): Collection<Tag> = charactersTagFlow().value.values

    fun alterationsTagFlow(): StateFlow<Map<String, Tag>> = store.alterationsTagFlow()

    fun alterationsTags(): Collection<Tag> = alterationsTagFlow().value.values

    fun itemsTagFlow(): StateFlow<Map<String, Tag>> = store.itemsTagFlow()

    fun itemsTags(): Collection<Tag> = itemsTagFlow().value.values
}