use crate::{game::score::VariantPlayerScore, player::Player};
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BasicScore {
score: u32,
}
impl BasicScore {
pub fn score_player(player: &Player) -> Self {
let score = player
.cards
.iter()
.fold(0, |score, card| score + card.score_value());
Self {
score: score.into(),
}
}
pub fn score(&self) -> u32 {
self.score
}
}
impl VariantPlayerScore for BasicScore {}