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")]