1pub use double_dot_macro_derive::*;
2pub use double_dot_macro_types::*;
3pub trait DoubleStates: Send + Sync + Default {
4 fn name(&self) -> &'static str;
6 fn linear_transition(&self) -> Self;
10 fn arbitrary_transition(&self, next_state: &Self) -> Self;
14 fn to_string(&self) -> String;
16 fn parse_arbs(&self, arbs: &str) -> Vec<String>;
18}
19
20#[allow(dead_code)]
22#[derive(Clone, Eq, PartialEq, Debug, Hash, DoubleStates, Default)]
23enum State {
24 #[linear(MainMenu)]
25 Loading,
26 #[arbitrary(Playing, Exit)]
27 MainMenu,
28 #[default]
29 #[linear(Paused)]
30 Playing,
31 #[arbitrary(MainMenu, Exit)]
32 Paused,
33 Exit,
34}