manabrew_engine/keyword/
suspend.rs1use super::keyword_instance::Keyword;
6use super::keyword_with_cost_and_amount::KeywordWithCostAndAmount;
7
8#[derive(Debug, Clone)]
12pub struct Suspend {
13 pub inner: KeywordWithCostAndAmount,
14 pub without_cost_and_amount: bool,
16}
17
18impl Suspend {
19 pub fn new(original: String) -> Self {
21 Self {
22 inner: KeywordWithCostAndAmount::new(Keyword::Suspend, original),
23 without_cost_and_amount: false,
24 }
25 }
26
27 pub fn parse(&mut self, details: &str) {
29 if details.is_empty() {
30 self.without_cost_and_amount = true;
31 } else {
32 self.inner.parse(details);
33 }
34 }
35
36 pub fn get_title(&self) -> String {
38 if self.without_cost_and_amount {
39 self.inner.base.keyword.display_name().to_string()
40 } else {
41 self.inner.get_title()
42 }
43 }
44
45 pub fn format_reminder_text(&self, reminder_text: &str) -> String {
47 if self.without_cost_and_amount {
48 "At the beginning of its owner's upkeep, remove a time counter from that card. When the last is removed, the player plays it without paying its mana cost. If it's a creature, it has haste.".to_string()
49 } else {
50 self.inner.format_reminder_text(reminder_text)
51 }
52 }
53}