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<()> {
|
pub fn curse(&self) -> Option<()> {
|
||||||
for t in &self.types {
|
for t in &self.types {
|
||||||
match t {
|
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| {
|
let score = p.draw_pile.iter().fold(0, |acc, card| {
|
||||||
if let Some(points) = card.victory() {
|
if let Some(points) = card.victory() {
|
||||||
acc + points
|
acc + points
|
||||||
|
} else if let Some(_) = card.curse() {
|
||||||
|
acc - 1
|
||||||
} else {
|
} else {
|
||||||
acc
|
acc
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user