1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
use crate::{
    Abnormalities, Aesthetic, Balls, Circumcision, CockStruct, Curvature, GetVariants, Shape,
    SizeType, Veininess, ID,
};

pub mod standard_prompt;
pub mod tui_prompt;

#[derive(Clone)]
pub struct UserData {
    pub user: ID,
    pub cock: CockStruct,
    pub state: AppState,
}

impl UserData {
    pub fn default() -> UserData {
        UserData {
            user: ID::Anonymous,
            cock: CockStruct::default(),
            state: AppState::default(),
        }
    }
}

#[derive(Clone, Copy)]
pub enum AppState {
    Home,
    Id,
    Abnormalities,
    Aesthetic,
    Balls,
    Circumcision,
    Curvature,
    Shape,
    Size,
    Veininess,
    Result,
}

impl AppState {
    pub fn default() -> AppState {
        AppState::Home
    }

    pub fn options(&self) -> Vec<String> {
        match self {
            AppState::Abnormalities => Abnormalities::get_variants(),
            AppState::Aesthetic => Aesthetic::get_variants(),
            AppState::Balls => Balls::get_variants(),
            AppState::Circumcision => Circumcision::get_variants(),
            AppState::Curvature => Curvature::get_variants(),
            AppState::Id => ID::get_variants(),
            AppState::Shape => Shape::get_variants(),
            AppState::Size => SizeType::get_variants(),
            AppState::Veininess => Veininess::get_variants(),
            _ => Vec::default(),
        }
    }

    pub fn as_str(&self) -> &str {
        match self {
            AppState::Home => "Home",
            AppState::Id => "ID",
            AppState::Abnormalities => "Abnormalities",
            AppState::Aesthetic => "Aesthetic",
            AppState::Balls => "Balls",
            AppState::Circumcision => "Circumcision",
            AppState::Curvature => "Curvature",
            AppState::Shape => "Shape",
            AppState::Size => "Size",
            AppState::Veininess => "Veininess",
            AppState::Result => "Result",
        }
    }

    pub fn next(&self) -> AppState {
        match self {
            AppState::Home => AppState::Id,
            AppState::Id => AppState::Size,
            AppState::Size => AppState::Abnormalities,
            AppState::Abnormalities => AppState::Aesthetic,
            AppState::Aesthetic => AppState::Balls,
            AppState::Balls => AppState::Circumcision,
            AppState::Circumcision => AppState::Curvature,
            AppState::Curvature => AppState::Shape,
            AppState::Shape => AppState::Veininess,
            AppState::Veininess => AppState::Result,
            AppState::Result => AppState::Result,
        }
    }

    pub fn prev(&self) -> AppState {
        match self {
            AppState::Home => AppState::Home,
            AppState::Id => AppState::Home,
            AppState::Size => AppState::Id,
            AppState::Abnormalities => AppState::Size,
            AppState::Aesthetic => AppState::Abnormalities,
            AppState::Balls => AppState::Aesthetic,
            AppState::Circumcision => AppState::Balls,
            AppState::Curvature => AppState::Circumcision,
            AppState::Shape => AppState::Curvature,
            AppState::Veininess => AppState::Shape,
            AppState::Result => AppState::Veininess,
        }
    }
}