Browse Source

RoomMode helper functions

pbs
jake 5 years ago
parent
commit
a0a0c38d66
  1. 21
      src/ship/room.rs

21
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,

Loading…
Cancel
Save