package com.pixelized.shared.lwa.protocol.websocket

import com.pixelized.shared.lwa.model.campaign.CampaignJson
import kotlinx.serialization.Serializable

@Serializable
sealed interface CampaignEvent : SocketMessage {

    // TODO Will probably be moved when the scene become more complex, (should already actually)
    @Serializable
    data class SceneUpdated(
        override val timestamp: Long,
        val name: String,
    ) : CampaignEvent

    @Serializable
    data class CharacterRemoved(
        override val timestamp: Long,
        override val characterSheetId: String,
    ) : CampaignEvent, CharacterSheetIdMessage

    @Serializable
    data class CharacterAdded(
        override val timestamp: Long,
        override val characterSheetId: String,
    ) : CampaignEvent, CharacterSheetIdMessage

    @Serializable
    data class NpcRemoved(
        override val timestamp: Long,
        override val characterSheetId: String,
    ) : CampaignEvent, CharacterSheetIdMessage

    @Serializable
    data class NpcAdded(
        override val timestamp: Long,
        override val characterSheetId: String,
    ) : CampaignEvent, CharacterSheetIdMessage

    @Serializable
    data class MapUpdated(
        override val timestamp: Long,
        val map: CampaignJson.MiniMap,
    ): CampaignEvent

    @Serializable
    data class MapDeleted(
        override val timestamp: Long,
    ): CampaignEvent
}