This repository has been archived on 2024-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
2023-07-04 16:32:57 +00:00
|
|
|
|
|
|
|
pub enum State {
|
|
|
|
None,
|
|
|
|
Main,
|
|
|
|
Setup,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Status {
|
|
|
|
state: State,
|
|
|
|
account_name: String,
|
|
|
|
account_user_id: String,
|
|
|
|
current_room_id: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for Status {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
state: State::None,
|
|
|
|
account_name: "".to_string(),
|
|
|
|
account_user_id: "".to_string(),
|
|
|
|
current_room_id: 0,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Status {
|
|
|
|
pub fn account_name(&self) -> &String {
|
|
|
|
&self.account_name
|
|
|
|
}
|
|
|
|
|
2023-07-06 15:34:55 +00:00
|
|
|
pub fn set_account_name(&mut self, name: String) {
|
|
|
|
self.account_name = name;
|
|
|
|
}
|
|
|
|
|
2023-07-04 16:32:57 +00:00
|
|
|
pub fn account_user_id(&self) -> &String {
|
|
|
|
&self.account_user_id
|
|
|
|
}
|
|
|
|
|
2023-07-06 15:34:55 +00:00
|
|
|
pub fn set_account_user_id(&mut self, user_id: String) {
|
|
|
|
self.account_user_id = user_id;
|
|
|
|
}
|
|
|
|
|
2023-07-04 16:32:57 +00:00
|
|
|
pub fn room(&self) -> Option<()> {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn state(&self) -> &State {
|
|
|
|
&self.state
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_state(&mut self, state: State) {
|
|
|
|
self.state = state;
|
|
|
|
}
|
|
|
|
}
|