package com.pixelized.desktop.lwa.repository.campaign

import com.pixelized.shared.lwa.model.campaign.Campaign
import kotlinx.coroutines.flow.StateFlow

class CampaignRepository(
    private val store: CampaignStore,
) {
    fun campaignFlow(): StateFlow<Campaign> {
        return store.campaignFlow()
    }

    suspend fun updateCampaign() {
        store.updateCampaignFlow()
    }

    suspend fun updateSceneTitle(
        title: String,
    ) {
        store.changeSceneTitle(title = title)
    }

    @Throws
    suspend fun addCharacter(
        characterSheetId: String,
    ) {
        store.addCharacter(
            characterSheetId = characterSheetId,
        )
    }

    @Throws
    suspend fun removeCharacter(
        characterSheetId: String,
    ) {
        store.removeCharacter(
            characterSheetId = characterSheetId,
        )
    }

    @Throws
    suspend fun addNpc(
        characterSheetId: String,
    ) {
        store.addNpc(
            characterSheetId = characterSheetId,
        )
    }

    @Throws
    suspend fun removeNpc(
        characterSheetId: String,
    ) {
        store.removeNpc(
            characterSheetId = characterSheetId,
        )
    }
}