use crate::ai::AIDifficulty;
-use crate::yew_components::MainMenuMessage;
use std::cell::Cell;
use std::fmt::Display;
use std::rc::Rc;
}
}
}
+
+// This enum moved from yew_components module so that this module would have no
+// dependencies on the yew_components module
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub enum MainMenuMessage {
+ SinglePlayer(Turn, AIDifficulty),
+ LocalMultiplayer,
+ NetworkedMultiplayer(Turn),
+}
append_to_info_text, element_append_class, element_remove_class, get_window_document,
};
use crate::random_helper::get_seeded_random;
-use crate::state::{BoardState, GameState, SharedState, Turn};
+use crate::state::{BoardState, GameState, MainMenuMessage, SharedState, Turn};
use std::cell::Cell;
use std::rc::Rc;
pub struct MainMenu {}
-pub enum MainMenuMessage {
- SinglePlayer(Turn, AIDifficulty),
- LocalMultiplayer,
- NetworkedMultiplayer(Turn),
-}
-
impl Component for MainMenu {
type Message = MainMenuMessage;
type Properties = ();