fantasy_realms_unofficial_api 0.1.0

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

pub(crate) const COLLECTOR: Card = Card {
    name: Name::Collector,
    suit: Suit::Wizard,
    strength: 7,
    adder: None,
    wild: None,
    modifier: None,
    immunity: None,
    blanks: None,
    bonus: Some(collector_bonus),
    penalty: None,
};

pub(crate) fn collector_bonus(hand: &ScoringHand) -> i16 {
    let max_number_of_same_suit = Suit::iter()
        .filter(|&suit| suit != Suit::Wild)
        .map(|suit| hand.number_of_suit(suit))
        .max()
        .unwrap_or(0);
    match max_number_of_same_suit {
        3 => 10,
        4 => 40,
        5 => 100,
        _ => 0,
    }
}