31 lines
615 B
Rust
31 lines
615 B
Rust
use std::fmt::Debug;
|
|
|
|
pub mod configure_game_rules;
|
|
pub mod confirm_dialog_screen;
|
|
pub mod game_screen;
|
|
pub mod input_screen;
|
|
pub mod popup_screen;
|
|
pub mod select_bot_type_screen;
|
|
pub mod select_play_mode_screen;
|
|
pub mod set_boats_layout_screen;
|
|
pub mod utils;
|
|
|
|
#[derive(Debug)]
|
|
pub enum ScreenResult<E = ()> {
|
|
Ok(E),
|
|
Canceled,
|
|
}
|
|
|
|
impl<E: Debug> ScreenResult<E> {
|
|
pub fn value(self) -> Option<E> {
|
|
match self {
|
|
ScreenResult::Ok(v) => Some(v),
|
|
ScreenResult::Canceled => None,
|
|
}
|
|
}
|
|
|
|
pub fn as_string(&self) -> String {
|
|
format!("{:#?}", self)
|
|
}
|
|
}
|