use crate::Element;
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
pub struct CardCost {
dice: DiceCost,
amount: u8,
energy: u8,
}
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
pub enum DiceCost {
Any,
Same,
Exact(Element)
}
impl CardCost {
pub(crate) const ZERO: Self = Self { dice: DiceCost::Same, amount: 0, energy: 0 };
pub(crate) const ONE: Self = Self { dice: DiceCost::Same, amount: 1, energy: 0 };
pub(crate) const ANY2: Self = Self { dice: DiceCost::Any, amount: 2, energy: 0 };
pub(crate) const MATCH2: Self = Self { dice: DiceCost::Same, amount: 2, energy: 0 };
pub(crate) const MATCH3: Self = Self { dice: DiceCost::Same, amount: 3, energy: 0 };
pub(crate) const fn new(dice: DiceCost, amount: u8, energy: u8) -> Self {
Self { dice, amount, energy }
}
pub fn dice_type(&self) -> DiceCost {
self.dice
}
pub fn amount(&self) -> u8 {
self.amount
}
pub fn energy(&self) -> u8 {
self.energy
}
}