Skip to main content

manabrew_engine/keyword/
simple_keyword.rs

1//! Simple keyword implementation (no parameters).
2//!
3//! Ported from Java's `SimpleKeyword.java` in `forge/game/keyword/`.
4
5use super::keyword_instance::{Keyword, KeywordInstanceData};
6
7/// A keyword with no additional parameters.
8/// Examples: Flying, Haste, Deathtouch, etc.
9#[derive(Debug, Clone)]
10pub struct SimpleKeyword {
11    pub base: KeywordInstanceData,
12}
13
14impl SimpleKeyword {
15    /// Create a new simple keyword.
16    pub fn new(keyword: Keyword, original: String) -> Self {
17        Self {
18            base: KeywordInstanceData::new(keyword, original),
19        }
20    }
21
22    /// Get the display title.
23    pub fn get_title(&self) -> String {
24        self.base.keyword.display_name().to_string()
25    }
26
27    /// Parse details (no-op for simple keywords).
28    pub fn parse(&mut self, _details: &str) {
29        // Simple keywords have no details to parse.
30    }
31
32    /// Format reminder text (returned as-is for simple keywords).
33    pub fn format_reminder_text(&self, reminder_text: &str) -> String {
34        reminder_text.to_string()
35    }
36}