pub struct AttackingBand {
pub attackers: Vec<CardId>,
pub blocked: Option<bool>,
}Expand description
A band of attacking creatures.
Mirrors Java’s AttackingBand.java.
In standard play, each band contains exactly one creature. The banding
keyword (from Alpha/early sets) allows multiple creatures to form a single
band. We store the full band structure for parity, but isValidBand only
handles single-creature bands and explicit banding — “bands with” is
stubbed.
Fields§
§attackers: Vec<CardId>§blocked: Option<bool>None = not yet determined, Some(true) = blocked, Some(false) = unblocked.
Implementations§
Source§impl AttackingBand
impl AttackingBand
pub fn new(card: CardId) -> Self
pub fn from_list(cards: Vec<CardId>) -> Self
pub fn get_attackers(&self) -> &[CardId]
pub fn add_attacker(&mut self, card: CardId)
pub fn remove_attacker(&mut self, card: CardId)
pub fn is_blocked(&self) -> Option<bool>
pub fn set_blocked(&mut self, value: bool)
pub fn is_empty(&self) -> bool
Sourcepub fn is_valid_band(
band: &[CardId],
cards: &[Card],
share_damage: bool,
) -> bool
pub fn is_valid_band( band: &[CardId], cards: &[Card], share_damage: bool, ) -> bool
Validate that a band is legal. For starting a band (share_damage =
false), all but one creature must have Banding. For sharing damage
(share_damage = true), at least one must have Banding.
Full “bands with” keyword support is stubbed — returns true for
single-creature bands, which covers 99.9% of actual play.
Sourcepub fn can_join_band(&self, card: CardId, cards: &[Card]) -> bool
pub fn can_join_band(&self, card: CardId, cards: &[Card]) -> bool
Check if card can join this existing band.
Trait Implementations§
Source§impl Clone for AttackingBand
impl Clone for AttackingBand
Source§fn clone(&self) -> AttackingBand
fn clone(&self) -> AttackingBand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more