Skip to main content

manabrew_engine/spellability/
trait_spell_ability.rs

1//! ISpellAbility trait -- marker trait for spell abilities.
2//! Mirrors Java's `ISpellAbility.java`.
3
4/// Marker trait for types that can be placed on the stack and resolved.
5/// In Rust, `SpellAbility` is the sole implementor.
6pub trait ISpellAbility {
7    /// Whether this is a spell (cast from hand/zone, uses the stack).
8    fn is_spell(&self) -> bool;
9    /// Whether this is an activated ability.
10    fn is_ability(&self) -> bool;
11    /// Whether this is a triggered ability.
12    fn is_trigger(&self) -> bool;
13}
14
15impl ISpellAbility for super::SpellAbility {
16    fn is_spell(&self) -> bool {
17        self.is_spell
18    }
19    fn is_ability(&self) -> bool {
20        self.is_activated
21    }
22    fn is_trigger(&self) -> bool {
23        self.is_trigger
24    }
25}