use super::keyword_instance::Keyword;
use super::keyword_with_amount::KeywordWithAmount;
#[derive(Debug, Clone)]
pub struct Modular {
pub inner: KeywordWithAmount,
pub sunburst: bool,
}
impl Modular {
pub fn new(original: String) -> Self {
Self {
inner: KeywordWithAmount::new(Keyword::Modular, original),
sunburst: false,
}
}
pub fn parse(&mut self, details: &str) {
if details == "Sunburst" {
self.sunburst = true;
} else {
self.inner.parse(details);
}
}
pub fn get_title(&self) -> String {
if self.sunburst {
"Modular\u{2014}Sunburst".to_string()
} else {
self.inner.get_title()
}
}
pub fn get_amount_string(&self) -> String {
if self.sunburst {
"Sunburst".to_string()
} else {
self.inner.get_amount_string()
}
}
pub fn format_reminder_text(&self, reminder_text: &str) -> String {
if self.sunburst {
"This enters with a +1/+1 counter on it for each color of mana spent to cast it. When it dies, you may put its +1/+1 counters on target artifact creature.".to_string()
} else {
self.inner.format_reminder_text(reminder_text)
}
}
}