Expand description
Spell – helper functions for cast spells.
Mirrors Java’s Spell.java (subclass of SpellAbility for spells cast from hand/zone).
In Rust the subclass is flattened: SpellAbility.is_spell == true marks a spell.
Functions§
- can_
play - Whether this spell can currently be played.
Mirrors Java’s
Spell.canPlay(). - can_
play_ from_ host - Whether this spell can be played from its host card.
Mirrors Java’s
Spell.canPlayFromHost(). Returns the card if playable, None otherwise. - check_
restrictions - Check cant-be-cast restrictions from static abilities.
Mirrors Java’s
Spell.checkRestrictions(). - is_
counterable_ by - Whether this spell can be countered by the given counter spell/ability.
Mirrors Java’s
Spell.isCounterableBy(SpellAbility). - set_
cast_ face_ down - Set whether this spell is cast face down (Morph).
Mirrors Java’s
Spell.setCastFaceDown(boolean).
Type Aliases§
- Spell
- Type alias for SpellAbility when used as a cast spell.
In Java,
Spellis a subclass; in Rust it’s the same struct withis_spell = true.