diff --git a/src/ship/room.rs b/src/ship/room.rs index d945ec8..a4fba17 100644 --- a/src/ship/room.rs +++ b/src/ship/room.rs @@ -91,6 +91,27 @@ pub enum RoomMode { } +impl RoomMode { + fn difficulty(&self) -> Difficulty { + match self { + RoomMode::Single {difficulty, ..} => *difficulty, + RoomMode::Multi {difficulty, ..} => *difficulty, + RoomMode::Battle {difficulty, ..} => *difficulty, + RoomMode::Challenge {..} => Difficulty::Normal, + } + } + + fn episode(&self) -> Episode { + match self { + RoomMode::Single {episode, ..} => *episode, + RoomMode::Multi {episode, ..} => *episode, + RoomMode::Battle {episode, ..} => *episode, + RoomMode::Challenge {episode, ..} => *episode, + } + } +} + + #[derive(Debug)] pub struct RoomState { mode: RoomMode,