Added the misc options
This commit is contained in:
39
src/infos.rs
39
src/infos.rs
@@ -1,5 +1,7 @@
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
use std::path::PathBuf;
|
||||
use std::slice::Iter;
|
||||
|
||||
// TODO - write some impl stuff in here so the main GUI stuff
|
||||
// is a little bit more decoupled from this. I think a Display
|
||||
@@ -17,3 +19,40 @@ pub struct LauncherInfo {
|
||||
pub path: PathBuf,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
pub enum Difficulty {
|
||||
None,
|
||||
Baby,
|
||||
Easy,
|
||||
Medium,
|
||||
Hard,
|
||||
Nightmare,
|
||||
}
|
||||
|
||||
impl fmt::Display for Difficulty {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Difficulty::Baby => write!(f, "I'm too young to die"),
|
||||
Difficulty::Easy => write!(f, "Hey, not too rough"),
|
||||
Difficulty::Medium => write!(f, "Hurt me plenty"),
|
||||
Difficulty::Hard => write!(f, "Ultra-Violence"),
|
||||
Difficulty::Nightmare => write!(f, "Nightmare!"),
|
||||
Difficulty::None => write!(f, "None"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Difficulty {
|
||||
pub fn iterator() -> Iter<'static, Difficulty> {
|
||||
static DIFFICULTIES: [Difficulty; 6] = [
|
||||
Difficulty::None,
|
||||
Difficulty::Baby,
|
||||
Difficulty::Easy,
|
||||
Difficulty::Medium,
|
||||
Difficulty::Hard,
|
||||
Difficulty::Nightmare,
|
||||
];
|
||||
DIFFICULTIES.iter()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user