From 583e941b6c7bd9f0a196d5138c3e6b4ed656afad Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 11 Feb 2024 02:31:38 +0100 Subject: [PATCH] fix --- src/azul.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/azul.rs b/src/azul.rs index 9d148af..ee3cb0c 100644 --- a/src/azul.rs +++ b/src/azul.rs @@ -26,7 +26,7 @@ pub struct GameState { rng: Box, } -#[derive(Serialize, Deserialize, Clone, Eq, PartialEq, Hash)] +#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, Hash)] pub struct PlayerName(String); impl From for PlayerName { @@ -351,6 +351,7 @@ impl GameState { let to_line = usize::min(amount, remaining_capacity); let to_floor = amount - to_line; + pattern_line.color = Some(c); pattern_line.number += to_line; self.players.get_mut(&self.current_player).unwrap() .floor @@ -370,10 +371,12 @@ impl GameState { .player_names .iter() .cycle() - .skip_while(|&a| a != &self.current_player) + .skip_while(|a| **a != self.current_player) + .skip(1) .next() .unwrap() .to_owned(); + Ok(()) } @@ -842,7 +845,6 @@ pub struct GameMove { } #[derive(Serialize, Deserialize, Clone, Copy)] -#[serde(untagged)] enum Policy { /// Anything weird will return an error #[serde(rename = "strict")]