//! UC-09 — one entry in a plugin's `condition_catalog()`. The play-
//! time character sheet renders these as the options of a multi-select
//! dropdown; selecting one toggles a `GameEvent::TagAdded` /
//! `TagRemoved` for the corresponding `key`.
//!
//! Lives in `sdk-types` (not `sdk-traits`) so the wire layer can
//! ship `Vec<TagSpec>` over the snapshot frame without pulling in
//! the trait surface.

/// One entry in a plugin's condition catalog. Pure data — no
/// references to plugin / handler / engine state. Plugins return
/// `Vec<TagSpec>` from `ModelPlugin::condition_catalog()`.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct TagSpec {
    /// Canonical key emitted in `Entity.tags` (e.g. `"dnd5e:prone"`).
    pub key:         String,
    /// Human-readable label shown in the dropdown (e.g. `"Prone"`).
    pub display:     String,
    /// Optional one-line tooltip (e.g. SRD rules-impact summary).
    pub description: Option<String>,
}

impl TagSpec {
    pub fn new(key: impl Into<String>, display: impl Into<String>) -> Self {
        Self { key: key.into(), display: display.into(), description: None }
    }

    pub fn with_description(mut self, description: impl Into<String>) -> Self {
        self.description = Some(description.into());
        self
    }
}
