feat: groundwork for multi-profile support
This commit is contained in:
@ -2,6 +2,27 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub enum Game {
|
||||
#[serde(rename = "ongeki")]
|
||||
Ongeki,
|
||||
#[serde(rename = "chunithm")]
|
||||
Chunithm,
|
||||
}
|
||||
}
|
||||
|
||||
impl Game {
|
||||
pub fn from_str(s: &str) -> Option<Game> {
|
||||
match s {
|
||||
"ongeki" => Some(Game::Ongeki),
|
||||
"chunithm" => Some(Game::Chunithm),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Game {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Game::Ongeki => write!(f, "ongeki"),
|
||||
Game::Chunithm => write!(f, "chunithm")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user