use super::keyword_instance::Keyword;
use super::keyword_with_cost::KeywordWithCost;
#[derive(Debug, Clone)]
pub struct Kicker {
pub inner: KeywordWithCost,
pub cost2: Option<String>,
}
impl Kicker {
pub fn new(original: String) -> Self {
Self {
inner: KeywordWithCost::new(Keyword::Kicker, original),
cost2: None,
}
}
pub fn parse(&mut self, details: &str) {
let parts: Vec<&str> = details.split(':').collect();
self.inner.parse(parts[0]);
if parts.len() > 1 {
self.cost2 = Some(parts[1].to_string());
}
}
pub fn format_reminder_text(&self, reminder_text: &str) -> String {
if let Some(ref cost2) = self.cost2 {
format!(
"You may pay an additional {} and/or {} as you cast this spell.",
self.inner.cost_string, cost2
)
} else {
self.inner.format_reminder_text(reminder_text)
}
}
pub fn get_title(&self) -> String {
self.inner.get_title()
}
}