Calculate curse cards in final score
This commit is contained in:
parent
7434dee715
commit
ea94aa5230
@ -86,7 +86,7 @@ impl Card {
|
||||
pub fn curse(&self) -> Option<()> {
|
||||
for t in &self.types {
|
||||
match t {
|
||||
CardType::Action(_) => return Some(()),
|
||||
CardType::Curse => return Some(()),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
@ -455,6 +455,8 @@ async fn broadcast_state(game: &Game) {
|
||||
let score = p.draw_pile.iter().fold(0, |acc, card| {
|
||||
if let Some(points) = card.victory() {
|
||||
acc + points
|
||||
} else if let Some(_) = card.curse() {
|
||||
acc - 1
|
||||
} else {
|
||||
acc
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user