diff --git a/front_end/src/state.rs b/front_end/src/state.rs index f455099..53ca272 100644 --- a/front_end/src/state.rs +++ b/front_end/src/state.rs @@ -1,5 +1,4 @@ use crate::ai::AIDifficulty; -use crate::yew_components::MainMenuMessage; use std::cell::Cell; use std::fmt::Display; use std::rc::Rc; @@ -288,3 +287,12 @@ impl Default for SharedState { } } } + +// 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), +} diff --git a/front_end/src/yew_components.rs b/front_end/src/yew_components.rs index e7897d1..a64b038 100644 --- a/front_end/src/yew_components.rs +++ b/front_end/src/yew_components.rs @@ -5,7 +5,7 @@ use crate::html_helper::{ 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; @@ -18,12 +18,6 @@ use yew::prelude::*; pub struct MainMenu {} -pub enum MainMenuMessage { - SinglePlayer(Turn, AIDifficulty), - LocalMultiplayer, - NetworkedMultiplayer(Turn), -} - impl Component for MainMenu { type Message = MainMenuMessage; type Properties = ();