pub struct CardLists;Expand description
Port of common CardLists utilities used by card filtering/counting code.
Implementations§
Source§impl CardLists
impl CardLists
pub fn filter_toughness( game: &GameState, cards: &[CardId], at_least_toughness: i32, ) -> Vec<CardId>
pub fn filter_power( game: &GameState, cards: &[CardId], at_least_power: i32, ) -> Vec<CardId>
pub fn filter_le_power( game: &GameState, cards: &[CardId], less_than_power: i32, ) -> Vec<CardId>
pub fn filter_any_counters( game: &GameState, cards: &[CardId], at_least_counters: i32, ) -> Vec<CardId>
pub fn sort_by_cmc_desc(game: &GameState, list: &mut [CardId])
pub fn sort_by_toughness_asc(game: &GameState, list: &mut [CardId])
pub fn sort_by_toughness_desc(game: &GameState, list: &mut [CardId])
pub fn sort_by_power_asc(game: &GameState, list: &mut [CardId])
pub fn sort_by_power_desc(game: &GameState, list: &mut [CardId])
pub fn shuffle(list: &mut [CardId])
pub fn filter_controlled_by( game: &GameState, cards: &[CardId], player: PlayerId, ) -> Vec<CardId>
pub fn filter_controlled_by_as_list( game: &GameState, cards: &[CardId], players: &[PlayerId], ) -> Vec<CardId>
pub fn can_subsequently_target( game: &GameState, cards: &[CardId], source: &SpellAbility, ) -> Vec<CardId>
pub fn test(game: &GameState, card: CardId, source: &SpellAbility) -> bool
pub fn filter( _game: &GameState, cards: &[CardId], filt: impl Fn(CardId) -> bool, ) -> Vec<CardId>
pub fn filter_as_list( game: &GameState, cards: &[CardId], restriction: &str, source_controller: PlayerId, ) -> Vec<CardId>
pub fn count( game: &GameState, cards: &[CardId], restriction: &str, source_controller: PlayerId, ) -> usize
pub fn filter_as_list_with_source( game: &GameState, cards: &[CardId], restriction: &str, source: CardId, ) -> Vec<CardId>
pub fn count_with_source( game: &GameState, cards: &[CardId], restriction: &str, source: CardId, ) -> usize
pub fn cmc_can_sum_to(sum: i32, cards: &[CardId], game: &GameState) -> bool
Auto Trait Implementations§
impl Freeze for CardLists
impl RefUnwindSafe for CardLists
impl Send for CardLists
impl Sync for CardLists
impl Unpin for CardLists
impl UnsafeUnpin for CardLists
impl UnwindSafe for CardLists
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.