fantasy_realms_unofficial_api 0.1.0

An unofficial API for the Fantasy Realms card game.
Documentation
use super::*;

pub(crate) const NECROMANCER: Card = Card {
    name: Name::Necromancer,
    suit: Suit::Wizard,
    strength: 3,
    adder: Some(necromancer_adder),
    wild: None,
    modifier: None,
    immunity: None,
    blanks: None,
    bonus: None,
    penalty: None,
};

pub(crate) fn necromancer_adder(hand: &Vec<Card>, discard_pile: &CardCollection) -> Vec<Vec<Card>> {
    discard_pile
        .iter()
        .filter_map(|card| {
            if matches!(card.suit, 
                Suit::Army   | 
                Suit::Leader | 
                Suit::Wizard | 
                Suit::Beast
            ) {
                let mut new_hand = hand.clone();
                new_hand.push(card);
                Some(new_hand)
            } else {
                None
            }
        })
        .collect::<Vec<Vec<Card>>>()
}