added to_string functions

This commit is contained in:
Nickiel12 2021-12-19 20:48:26 -08:00
parent 9c0f669874
commit bfacd35cd8

View file

@ -1,3 +1,5 @@
use std::str::FromStr;
#[derive(PartialEq, Debug, Clone, Copy)] #[derive(PartialEq, Debug, Clone, Copy)]
pub enum SubScenes { pub enum SubScenes {
@ -12,6 +14,20 @@ pub enum SubScenes {
} }
impl SubScenes {
pub fn to_string(&self) -> String {
match self {
SubScenes::CameraDefault => {String::from_str("Camera_Default").unwrap()},
SubScenes::CameraWithUpperRight => {String::from_str("Camera_Top_Right").unwrap()},
SubScenes::CameraWithLargeUpperRight => {String::from_str("Camera_Bottom_Left").unwrap()},
SubScenes::CameraWithLowerRight => {String::from_str("Camera_Bottom_Right").unwrap()},
SubScenes::ScreenDefault => {String::from_str("Screen_Default").unwrap()},
SubScenes::ScreenWithUpperRight => {String::from_str("Screen_Top_Right").unwrap()},
SubScenes::ScreenWithLowerRight => {String::from_str("Screen_Bottom_Right").unwrap()},
}
}
}
#[derive(PartialEq, Debug, Clone, Copy)] #[derive(PartialEq, Debug, Clone, Copy)]
pub enum Scenes { pub enum Scenes {
Camera, Camera,
@ -19,3 +35,13 @@ pub enum Scenes {
Augmented Augmented
} }
impl Scenes {
pub fn to_string(&self) -> String {
match self {
Scenes::Camera => {String::from_str("Scene_Camera").unwrap()},
Scenes::Screen => {String::from_str("Scene_Screen").unwrap()},
Scenes::Augmented => {String::from_str("Augmented").unwrap()},
}
}
}