manabrew_engine/keyword/
trample.rs1use super::keyword_instance::Keyword;
6use super::keyword_with_type::KeywordWithType;
7
8#[derive(Debug, Clone)]
12pub struct Trample {
13 pub inner: KeywordWithType,
14}
15
16impl Trample {
17 pub fn new(original: String) -> Self {
19 Self {
20 inner: KeywordWithType::new(Keyword::Trample, original),
21 }
22 }
23
24 pub fn parse(&mut self, details: &str) {
26 self.inner.parse(details);
27 }
28
29 pub fn get_title(&self) -> String {
31 if !self.inner.type_str.is_empty() {
32 "Trample over planeswalkers".to_string()
33 } else {
34 "Trample".to_string()
35 }
36 }
37
38 pub fn format_reminder_text(&self, reminder_text: &str) -> String {
40 if !self.inner.type_str.is_empty() {
41 "This creature can deal excess combat damage to the controller of the planeswalker it's attacking.".to_string()
42 } else {
43 reminder_text.to_string()
44 }
45 }
46}