use super::keyword_instance::Keyword;
use super::keyword_with_amount::KeywordWithAmount;
#[derive(Debug, Clone)]
pub struct Vanishing {
pub inner: KeywordWithAmount,
pub without_amount: bool,
}
impl Vanishing {
pub fn new(original: String) -> Self {
Self {
inner: KeywordWithAmount::new(Keyword::Vanishing, original),
without_amount: false,
}
}
pub fn parse(&mut self, details: &str) {
if details.is_empty() {
self.without_amount = true;
} else {
self.inner.parse(details);
}
}
pub fn get_title(&self) -> String {
if self.without_amount {
self.inner.base.keyword.display_name().to_string()
} else {
self.inner.get_title()
}
}
pub fn format_reminder_text(&self, reminder_text: &str) -> String {
if self.without_amount {
"At the beginning of your upkeep, remove a time counter from this enchantment. When the last is removed, sacrifice it.".to_string()
} else {
self.inner.format_reminder_text(reminder_text)
}
}
}