This commit is contained in:
Henri Bourcereau 2025-01-15 17:46:39 +01:00
parent 53f95c0fe4
commit 0edcb3e810
2 changed files with 11 additions and 5 deletions

View file

@ -1,4 +1,4 @@
use bot::{Bot, BotStrategy, DefaultStrategy}; use bot::{Bot, BotStrategy};
use store::{CheckerMove, DiceRoller, GameEvent, GameState, PlayerId, TurnStage}; use store::{CheckerMove, DiceRoller, GameEvent, GameState, PlayerId, TurnStage};
// Application Game // Application Game

View file

@ -618,13 +618,19 @@ pub enum GameEvent {
impl GameEvent { impl GameEvent {
pub fn player_id(&self) -> Option<PlayerId> { pub fn player_id(&self) -> Option<PlayerId> {
match self { match self {
Self::PlayerJoined { player_id, name } => Some(*player_id), Self::PlayerJoined { player_id, name: _ } => Some(*player_id),
Self::PlayerDisconnected { player_id } => Some(*player_id), Self::PlayerDisconnected { player_id } => Some(*player_id),
Self::Roll { player_id } => Some(*player_id), Self::Roll { player_id } => Some(*player_id),
Self::RollResult { player_id, dice } => Some(*player_id), Self::RollResult { player_id, dice: _ } => Some(*player_id),
Self::Mark { player_id, points } => Some(*player_id), Self::Mark {
player_id,
points: _,
} => Some(*player_id),
Self::Go { player_id } => Some(*player_id), Self::Go { player_id } => Some(*player_id),
Self::Move { player_id, moves } => Some(*player_id), Self::Move {
player_id,
moves: _,
} => Some(*player_id),
_ => None, _ => None,
} }
} }