use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq, specta::Type)]
#[serde(rename_all = "camelCase")]
pub enum Modification {
CopyTagsFrom {
identifier: String,
},
ApplyCreatureVariation {
identifier: String,
},
AddToEnding {
raws: Vec<String>,
},
AddToBeginning {
raws: Vec<String>,
},
AddBeforeTag {
tag: String,
raws: Vec<String>,
},
MainRawBody {
raws: Vec<String>,
},
}
impl Modification {
pub(crate) fn add_raw(&mut self, format: String) {
match self {
Self::AddToEnding { raws }
| Self::AddToBeginning { raws }
| Self::AddBeforeTag { raws, .. }
| Self::MainRawBody { raws } => raws.push(format),
_ => {}
}
}
}