refact
This commit is contained in:
parent
53f95c0fe4
commit
0edcb3e810
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue