use super::keyword_instance::Keyword;
use super::keyword_with_cost::KeywordWithCost;
#[derive(Debug, Clone)]
pub struct Equip {
pub inner: KeywordWithCost,
pub equip_type: String,
}
impl Equip {
pub fn new(original: String) -> Self {
Self {
inner: KeywordWithCost::new(Keyword::Equip, original),
equip_type: "creature".to_string(),
}
}
pub fn parse(&mut self, details: &str) {
let k: Vec<&str> = details.split(':').collect();
self.inner.parse(k[0]);
if k.len() > 2 {
self.equip_type = k[2].to_string();
}
}
pub fn get_valid_description(&self) -> &str {
&self.equip_type
}
pub fn format_reminder_text(&self, reminder_text: &str) -> String {
reminder_text
.replace("%s", &self.inner.cost_string)
.replace("%1$s", &self.inner.cost_string)
.replace("%2$s", &self.equip_type)
}
pub fn get_title(&self) -> String {
self.inner.get_title()
}
}