diff --git a/werewolves-macros/src/ref_and_mut.rs b/werewolves-macros/src/ref_and_mut.rs index d91ccf3..911ef83 100644 --- a/werewolves-macros/src/ref_and_mut.rs +++ b/werewolves-macros/src/ref_and_mut.rs @@ -13,8 +13,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . use quote::{ToTokens, quote}; -use syn::{parse::Parse, spanned::Spanned}; - +use syn::parse::Parse; +#[allow(unused)] pub struct RefAndMut { name: syn::Ident, } diff --git a/werewolves-proto/src/game/kill.rs b/werewolves-proto/src/game/kill.rs index 06399db..60a7314 100644 --- a/werewolves-proto/src/game/kill.rs +++ b/werewolves-proto/src/game/kill.rs @@ -12,7 +12,7 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::{num::NonZeroU8, ops::Not}; +use core::num::NonZeroU8; use super::Result; use crate::{ diff --git a/werewolves-proto/src/game/night/process.rs b/werewolves-proto/src/game/night/process.rs index 07aec77..512e761 100644 --- a/werewolves-proto/src/game/night/process.rs +++ b/werewolves-proto/src/game/night/process.rs @@ -24,7 +24,7 @@ use crate::{ }, message::night::{ActionPrompt, ActionResponse, ActionResult}, player::Protection, - role::{Alignment, AlignmentEq, PreviousGuardianAction, RoleBlock, RoleTitle}, + role::{AlignmentEq, PreviousGuardianAction, RoleBlock, RoleTitle}, }; type Result = core::result::Result; diff --git a/werewolves-proto/src/game/settings/settings_role.rs b/werewolves-proto/src/game/settings/settings_role.rs index 04e3e75..7ab219e 100644 --- a/werewolves-proto/src/game/settings/settings_role.rs +++ b/werewolves-proto/src/game/settings/settings_role.rs @@ -23,7 +23,7 @@ use uuid::Uuid; use werewolves_macros::{All, ChecksAs, Titles}; use crate::{ - aura::{Aura, AuraTitle}, + aura::AuraTitle, character::Character, error::GameError, message::Identification, diff --git a/werewolves-proto/src/game/village.rs b/werewolves-proto/src/game/village.rs index 6427e0c..75f58a4 100644 --- a/werewolves-proto/src/game/village.rs +++ b/werewolves-proto/src/game/village.rs @@ -20,7 +20,6 @@ use serde::{Deserialize, Serialize}; use super::Result; use crate::{ - aura::Aura, character::{Character, CharacterId}, diedto::DiedTo, error::GameError, diff --git a/werewolves-proto/src/game_test/mod.rs b/werewolves-proto/src/game_test/mod.rs index 31bfd2b..40c94d6 100644 --- a/werewolves-proto/src/game_test/mod.rs +++ b/werewolves-proto/src/game_test/mod.rs @@ -259,7 +259,7 @@ impl ActionResultExt for ActionResult { } } } - +#[allow(unused)] pub trait AlignmentExt { fn village(&self); fn wolves(&self); @@ -275,6 +275,7 @@ impl AlignmentExt for Alignment { } } +#[allow(unused)] pub trait ServerToHostMessageExt { fn prompt(self) -> ActionPrompt; fn result(self) -> ActionResult; @@ -853,7 +854,7 @@ fn big_game_test_based_on_story_test() { settings.add_and_assign(scapegoat.0, scapegoat.1); settings.add_and_assign(hunter.0, hunter.1); settings.fill_remaining_slots_with_villagers(players.len()); - + #[allow(unused)] let ( werewolf, dire_wolf, diff --git a/werewolves-proto/src/game_test/previous.rs b/werewolves-proto/src/game_test/previous.rs index 69c0d32..9fb4e05 100644 --- a/werewolves-proto/src/game_test/previous.rs +++ b/werewolves-proto/src/game_test/previous.rs @@ -21,8 +21,7 @@ use crate::{ diedto::DiedToTitle, game::{Game, GameSettings, GameState, OrRandom, SetupRole}, game_test::{ - ActionPromptTitleExt, ActionResultExt, GameExt, ServerToHostMessageExt, SettingsExt, - gen_players, init_log, + ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log, }, message::{ Identification, PublicIdentity, @@ -228,7 +227,7 @@ fn previous_prompt() { settings.add_and_assign(scapegoat.0, scapegoat.1); settings.add_and_assign(hunter.0, hunter.1); settings.fill_remaining_slots_with_villagers(players.len()); - + #[allow(unused)] let ( werewolf, dire_wolf, diff --git a/werewolves-proto/src/game_test/revert.rs b/werewolves-proto/src/game_test/revert.rs index 5722fb0..c7aa70a 100644 --- a/werewolves-proto/src/game_test/revert.rs +++ b/werewolves-proto/src/game_test/revert.rs @@ -17,7 +17,7 @@ use crate::{ game_test::{ ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log, }, - message::{CharacterIdentity, night::ActionPrompt}, + message::night::ActionPrompt, role::{Role, RoleTitle}, }; diff --git a/werewolves-proto/src/game_test/role/apprentice.rs b/werewolves-proto/src/game_test/role/apprentice.rs index c00c296..4421e7c 100644 --- a/werewolves-proto/src/game_test/role/apprentice.rs +++ b/werewolves-proto/src/game_test/role/apprentice.rs @@ -12,22 +12,14 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::num::NonZeroU8; #[allow(unused)] use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; use crate::{ - diedto::DiedTo, - game::{Game, GameSettings, OrRandom, SetupRole}, - game_test::{ - ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt, - SettingsExt, gen_players, - }, - message::{ - host::{HostDayMessage, HostGameMessage}, - night::{ActionPrompt, ActionPromptTitle, ActionResult}, - }, - role::{Role, RoleTitle}, + game::{Game, GameSettings, SetupRole}, + game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players}, + message::night::{ActionPrompt, ActionPromptTitle}, + role::RoleTitle, }; #[test] diff --git a/werewolves-proto/src/game_test/role/black_knight.rs b/werewolves-proto/src/game_test/role/black_knight.rs index a61d0ac..587c16d 100644 --- a/werewolves-proto/src/game_test/role/black_knight.rs +++ b/werewolves-proto/src/game_test/role/black_knight.rs @@ -18,16 +18,9 @@ use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; use crate::{ diedto::DiedTo, - game::{Game, GameSettings, OrRandom, SetupRole}, - game_test::{ - ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt, - SettingsExt, gen_players, - }, - message::{ - host::{HostDayMessage, HostGameMessage}, - night::{ActionPrompt, ActionPromptTitle, ActionResult}, - }, - role::Role, + game::{Game, GameSettings, SetupRole}, + game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players}, + message::night::ActionPromptTitle, }; #[test] diff --git a/werewolves-proto/src/game_test/role/diseased.rs b/werewolves-proto/src/game_test/role/diseased.rs index 0ef3f36..544373c 100644 --- a/werewolves-proto/src/game_test/role/diseased.rs +++ b/werewolves-proto/src/game_test/role/diseased.rs @@ -18,16 +18,15 @@ use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; use crate::{ diedto::DiedTo, - game::{Game, GameSettings, OrRandom, SetupRole}, + game::{Game, GameSettings, SetupRole}, game_test::{ - ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt, - SettingsExt, gen_players, + ActionPromptTitleExt, ActionResultExt, GameExt, ServerToHostMessageExt, SettingsExt, + gen_players, }, message::{ host::{HostDayMessage, HostGameMessage}, - night::{ActionPrompt, ActionPromptTitle, ActionResult}, + night::{ActionPrompt, ActionPromptTitle}, }, - role::Role, }; #[test] diff --git a/werewolves-proto/src/game_test/role/elder.rs b/werewolves-proto/src/game_test/role/elder.rs index 3d1ec4e..1319326 100644 --- a/werewolves-proto/src/game_test/role/elder.rs +++ b/werewolves-proto/src/game_test/role/elder.rs @@ -18,7 +18,7 @@ use crate::{ diedto::DiedTo, game::{Game, GameSettings, SetupRole}, game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players}, - message::night::{ActionPrompt, ActionPromptTitle}, + message::night::ActionPromptTitle, role::{Alignment, Role}, }; #[allow(unused)] diff --git a/werewolves-proto/src/game_test/role/empath.rs b/werewolves-proto/src/game_test/role/empath.rs index ce4bdd5..797965a 100644 --- a/werewolves-proto/src/game_test/role/empath.rs +++ b/werewolves-proto/src/game_test/role/empath.rs @@ -12,16 +12,13 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::num::NonZeroU8; #[allow(unused)] use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; use crate::{ game::{Game, GameSettings, OrRandom, SetupRole}, - game_test::{ - ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, SettingsExt, gen_players, - }, - message::night::{ActionPrompt, ActionPromptTitle, ActionResult}, + game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players}, + message::night::{ActionPromptTitle, ActionResult}, role::Role, }; diff --git a/werewolves-proto/src/game_test/role/hunter.rs b/werewolves-proto/src/game_test/role/hunter.rs index 4f91340..c67ae6e 100644 --- a/werewolves-proto/src/game_test/role/hunter.rs +++ b/werewolves-proto/src/game_test/role/hunter.rs @@ -12,20 +12,13 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::num::NonZeroU8; - use crate::{ - diedto::DiedTo, - error::GameError, game::{Game, GameSettings, SetupRole}, game_test::{ ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log, }, - message::{ - host::{HostGameMessage, HostNightMessage}, - night::{ActionPromptTitle, ActionResponse}, - }, - role::{PreviousGuardianAction, Role}, + message::night::ActionPromptTitle, + role::Role, }; #[test] diff --git a/werewolves-proto/src/game_test/role/insomniac.rs b/werewolves-proto/src/game_test/role/insomniac.rs index 5f34e33..7a112e6 100644 --- a/werewolves-proto/src/game_test/role/insomniac.rs +++ b/werewolves-proto/src/game_test/role/insomniac.rs @@ -16,11 +16,8 @@ use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; use crate::{ - diedto::DiedTo, - game::{Game, GameSettings, OrRandom, SetupRole}, - game_test::{ - ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, SettingsExt, gen_players, - }, + game::{Game, GameSettings, SetupRole}, + game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players}, message::night::{ActionPromptTitle, Visits}, role::{Role, RoleTitle}, }; diff --git a/werewolves-proto/src/game_test/role/maple_wolf.rs b/werewolves-proto/src/game_test/role/maple_wolf.rs index 11bf0f7..a019123 100644 --- a/werewolves-proto/src/game_test/role/maple_wolf.rs +++ b/werewolves-proto/src/game_test/role/maple_wolf.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::num::{NonZero, NonZeroU8}; +use core::num::NonZeroU8; #[allow(unused)] use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; @@ -27,7 +27,6 @@ use crate::{ ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log, }, message::night::ActionPromptTitle, - role::{Alignment, Killer, Powerful}, }; #[test] diff --git a/werewolves-proto/src/game_test/role/mason.rs b/werewolves-proto/src/game_test/role/mason.rs index 5728f8c..4df4b3b 100644 --- a/werewolves-proto/src/game_test/role/mason.rs +++ b/werewolves-proto/src/game_test/role/mason.rs @@ -12,7 +12,7 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::num::{NonZero, NonZeroU8}; +use core::num::NonZeroU8; #[allow(unused)] use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; diff --git a/werewolves-proto/src/game_test/role/mortician.rs b/werewolves-proto/src/game_test/role/mortician.rs index da61825..3be62a9 100644 --- a/werewolves-proto/src/game_test/role/mortician.rs +++ b/werewolves-proto/src/game_test/role/mortician.rs @@ -12,15 +12,13 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::num::NonZeroU8; #[allow(unused)] use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; use crate::{ - diedto::DiedTo, game::{Game, GameSettings, SetupRole}, - game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players}, - message::night::{ActionPrompt, ActionPromptTitle}, + game_test::{ActionResultExt, GameExt, SettingsExt, gen_players}, + message::night::ActionPromptTitle, }; #[test] diff --git a/werewolves-proto/src/game_test/role/weightlifter.rs b/werewolves-proto/src/game_test/role/weightlifter.rs index de4e7b7..d078e3a 100644 --- a/werewolves-proto/src/game_test/role/weightlifter.rs +++ b/werewolves-proto/src/game_test/role/weightlifter.rs @@ -12,22 +12,13 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::num::NonZeroU8; #[allow(unused)] use pretty_assertions::{assert_eq, assert_ne, assert_str_eq}; use crate::{ - diedto::DiedTo, - game::{Game, GameOver, GameSettings, OrRandom, SetupRole}, - game_test::{ - ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt, - SettingsExt, gen_players, - }, - message::{ - host::{HostDayMessage, HostGameMessage, ServerToHostMessage}, - night::{ActionPrompt, ActionPromptTitle, ActionResult}, - }, - role::Role, + game::{Game, GameOver, GameSettings, SetupRole}, + game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players}, + message::night::ActionPromptTitle, }; #[test] diff --git a/werewolves-proto/src/role.rs b/werewolves-proto/src/role.rs index 7ec07d8..101e4e2 100644 --- a/werewolves-proto/src/role.rs +++ b/werewolves-proto/src/role.rs @@ -18,12 +18,10 @@ use serde::{Deserialize, Serialize}; use werewolves_macros::{ChecksAs, Titles}; use crate::{ - aura::Aura, - character::{Character, CharacterId}, + character::CharacterId, diedto::DiedTo, game::{GameTime, Village}, - message::{CharacterIdentity, Identification, PublicIdentity, night::ActionType}, - player::PlayerId, + message::CharacterIdentity, }; #[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Default)] diff --git a/werewolves-server/src/client.rs b/werewolves-server/src/client.rs index 1ab0311..6786c19 100644 --- a/werewolves-server/src/client.rs +++ b/werewolves-server/src/client.rs @@ -15,7 +15,7 @@ use core::{net::SocketAddr, time::Duration}; use crate::{ - AppState, LogError, XForwardedFor, + AppState, XForwardedFor, connection::{ConnectionId, JoinedPlayer}, runner::IdentifiedClientMessage, }; @@ -26,7 +26,7 @@ use axum::{ }, response::IntoResponse, }; -use axum_extra::{TypedHeader, headers}; +use axum_extra::TypedHeader; use chrono::Utc; use colored::Colorize; use tokio::sync::broadcast::{Receiver, Sender}; @@ -34,7 +34,6 @@ use werewolves_proto::message::{ClientMessage, Identification, ServerMessage, Up pub async fn handler( ws: WebSocketUpgrade, - user_agent: Option>, x_forwarded_for: Option>, ConnectInfo(addr): ConnectInfo, State(state): State, @@ -43,12 +42,7 @@ pub async fn handler( .map(|x| x.to_string()) .unwrap_or_else(|| addr.to_string()) .italic(); - // log::debug!( - // "{who}{} connected.", - // user_agent - // .map(|agent| format!(" (User-Agent: {})", agent.as_str())) - // .unwrap_or_default(), - // ); + let player_list = state.joined_players; // finalize the upgrade process by returning upgrade callback. @@ -208,7 +202,7 @@ impl Client { return Ok(()); } - Message::Close(Some(close_frame)) => { + Message::Close(Some(_)) => { // log::debug!("sent close frame: {close_frame:?}"); return Ok(()); } diff --git a/werewolves/src/clients/client/client.rs b/werewolves/src/clients/client/client.rs index fe97e33..c54ac9d 100644 --- a/werewolves/src/clients/client/client.rs +++ b/werewolves/src/clients/client/client.rs @@ -12,7 +12,7 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::sync::atomic::{AtomicBool, AtomicI64, AtomicPtr, AtomicU64, AtomicUsize, Ordering}; +use core::sync::atomic::{AtomicBool, AtomicI64, Ordering}; use std::rc::Rc; use chrono::{DateTime, TimeDelta, Utc}; diff --git a/werewolves/src/clients/host/host.rs b/werewolves/src/clients/host/host.rs index 393ce2c..71faad7 100644 --- a/werewolves/src/clients/host/host.rs +++ b/werewolves/src/clients/host/host.rs @@ -41,7 +41,7 @@ use yew::{html::Scope, prelude::*}; use crate::{ callback, components::{ - Button, CoverOfDarkness, Lobby, LobbyPlayerAction, RoleReveal, Settings, Story, Victory, + Button, Lobby, LobbyPlayerAction, RoleReveal, Settings, Story, Victory, action::{ActionResultView, Prompt}, host::{DaytimePlayerList, Setup}, }, @@ -224,6 +224,7 @@ pub enum HostState { Result(Option, ActionResult), Story { story: GameStory, + #[allow(unused)] page: usize, }, } @@ -311,7 +312,7 @@ impl Component for Host { fn view(&self, _ctx: &Context) -> Html { log::trace!("state: {:?}", self.state); let content = match self.state.clone() { - HostState::Story { story, page } => { + HostState::Story { story, .. } => { if let Some(outcome) = story .final_village() .ok() @@ -611,8 +612,7 @@ impl Component for Host { } }, HostEvent::Error(err) => { - self.error_callback - .emit(Some(WerewolfError::GameError(err))); + self.error_callback.emit(Some(WerewolfError::Game(err))); false } HostEvent::SetBigScreenState(state) => { diff --git a/werewolves/src/clients/host/story_test.rs b/werewolves/src/clients/host/story_test.rs index 926f755..d3ea1a0 100644 --- a/werewolves/src/clients/host/story_test.rs +++ b/werewolves/src/clients/host/story_test.rs @@ -16,8 +16,8 @@ use core::num::NonZeroU8; use werewolves_proto::{ character::{Character, CharacterId}, - diedto::{DiedTo, DiedToTitle}, - game::{self, Game, GameOver, GameSettings, OrRandom, SetupRole, Village, story::GameStory}, + diedto::DiedToTitle, + game::{self, Game, GameOver, GameSettings, OrRandom, SetupRole, story::GameStory}, message::{ CharacterState, Identification, PublicIdentity, host::{HostDayMessage, HostGameMessage, HostNightMessage, ServerToHostMessage}, @@ -121,7 +121,7 @@ pub fn test_story() -> GameStory { settings.add_and_assign(hunter.0, hunter.1); settings.add_and_assign(diseased.0, diseased.1); settings.fill_remaining_slots_with_villagers(players.len()); - + #[allow(unused)] let ( werewolf, dire_wolf, @@ -596,6 +596,7 @@ impl ActionPromptTitleExt for ActionPromptTitle { } } +#[allow(unused)] pub trait ActionResultExt { fn sleep(&self); fn r#continue(&self); @@ -655,7 +656,7 @@ impl ActionResultExt for ActionResult { fn seer(&self) -> Alignment { match self { - ActionResult::Seer(a) => a.clone(), + ActionResult::Seer(a) => *a, _ => panic!("expected a seer result"), } } @@ -674,7 +675,7 @@ impl ActionResultExt for ActionResult { } } } - +#[allow(unused)] pub trait AlignmentExt { fn village(&self); fn wolves(&self); @@ -689,7 +690,7 @@ impl AlignmentExt for Alignment { assert_eq!(*self, Alignment::Wolves) } } - +#[allow(unused)] pub trait ServerToHostMessageExt { fn prompt(self) -> ActionPrompt; fn result(self) -> ActionResult; @@ -725,6 +726,7 @@ impl ServerToHostMessageExt for ServerToHostMessage { } } +#[allow(unused)] pub trait GameExt { fn villager_character_ids(&self) -> Box<[CharacterId]>; fn character_by_player_id(&self, player_id: PlayerId) -> Character; diff --git a/werewolves/src/components/action/prompt.rs b/werewolves/src/components/action/prompt.rs index d1ee15b..66c102e 100644 --- a/werewolves/src/components/action/prompt.rs +++ b/werewolves/src/components/action/prompt.rs @@ -22,7 +22,6 @@ use werewolves_proto::{ host::{HostGameMessage, HostMessage, HostNightMessage}, night::{ActionPrompt, ActionResponse}, }, - role::PreviousGuardianAction, }; use yew::prelude::*; @@ -31,7 +30,7 @@ use crate::{ Button, CoverOfDarkness, Identity, action::{BinaryChoice, TargetPicker, WolvesIntro}, }, - pages::{MasonsWake, TraitorIntroPage}, + pages::TraitorIntroPage, }; #[derive(Debug, Clone, PartialEq, Properties)] diff --git a/werewolves/src/components/action/result.rs b/werewolves/src/components/action/result.rs index 280b3dd..5123f6e 100644 --- a/werewolves/src/components/action/result.rs +++ b/werewolves/src/components/action/result.rs @@ -14,7 +14,6 @@ // along with this program. If not, see . use core::ops::Not; -use convert_case::{Case, Casing}; use werewolves_proto::message::{ PublicIdentity, host::{HostGameMessage, HostMessage, HostNightMessage}, @@ -23,7 +22,7 @@ use werewolves_proto::message::{ use yew::prelude::*; use crate::{ - components::{Button, CoverOfDarkness, Icon, IconSource, Identity}, + components::{Button, CoverOfDarkness, Identity}, pages::{ AdjudicatorResult, ArcanistResult, BeholderSawEverything, BeholderSawNothing, DrunkPage, EmpathResult, GravediggerResultPage, InsomniacResult, MorticianResultPage, PowerSeerResult, diff --git a/werewolves/src/components/attributes/death_span.rs b/werewolves/src/components/attributes/death_span.rs index 306812b..e34c4c6 100644 --- a/werewolves/src/components/attributes/death_span.rs +++ b/werewolves/src/components/attributes/death_span.rs @@ -13,14 +13,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . use convert_case::{Case, Casing}; -use werewolves_proto::{ - diedto::{DiedTo, DiedToTitle}, - game::{Category, SetupRoleTitle}, - role, -}; +use werewolves_proto::{diedto::DiedToTitle, game::SetupRoleTitle}; use yew::prelude::*; -use crate::components::{AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon}; +use crate::components::{Icon, IconSource, IconType, PartialAssociatedIcon}; #[derive(Debug, Clone, Copy, PartialEq, Properties)] pub struct DiedToSpanProps { diff --git a/werewolves/src/components/attributes/killer.rs b/werewolves/src/components/attributes/killer.rs index e40d1ab..76dc943 100644 --- a/werewolves/src/components/attributes/killer.rs +++ b/werewolves/src/components/attributes/killer.rs @@ -12,7 +12,7 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use werewolves_proto::role::{self, Killer}; +use werewolves_proto::role::Killer; use yew::prelude::*; use crate::components::{AssociatedIcon, Icon, IconType}; diff --git a/werewolves/src/components/host/daytime.rs b/werewolves/src/components/host/daytime.rs index 8e5d2d6..87b5776 100644 --- a/werewolves/src/components/host/daytime.rs +++ b/werewolves/src/components/host/daytime.rs @@ -24,7 +24,6 @@ use yew::prelude::*; use crate::components::{ AssociatedIcon, Button, Icon, IconType, Identity, PartialAssociatedIcon, - attributes::RoleTitleSpan, }; #[derive(Debug, Clone, PartialEq, Properties)] diff --git a/werewolves/src/components/host/setup.rs b/werewolves/src/components/host/setup.rs index 797908a..ad8934e 100644 --- a/werewolves/src/components/host/setup.rs +++ b/werewolves/src/components/host/setup.rs @@ -16,11 +16,7 @@ use core::ops::Not; use std::collections::HashMap; use convert_case::{Case, Casing}; -use rand::Rng; -use werewolves_proto::{ - game::{Category, GameSettings, SetupRole, SetupRoleTitle}, - role::Alignment, -}; +use werewolves_proto::game::{Category, GameSettings, SetupRole, SetupRoleTitle}; use yew::prelude::*; use crate::components::{AssociatedIcon, Icon, IconSource, IconType}; diff --git a/werewolves/src/components/icon.rs b/werewolves/src/components/icon.rs index a8e2976..065fd6e 100644 --- a/werewolves/src/components/icon.rs +++ b/werewolves/src/components/icon.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . use werewolves_proto::{ - aura::{Aura, AuraTitle}, + aura::AuraTitle, diedto::DiedToTitle, role::{Alignment, Killer, Powerful, RoleTitle}, }; diff --git a/werewolves/src/components/settings.rs b/werewolves/src/components/settings.rs index d38de05..5395784 100644 --- a/werewolves/src/components/settings.rs +++ b/werewolves/src/components/settings.rs @@ -17,7 +17,7 @@ use std::rc::Rc; use convert_case::{Case, Casing}; use werewolves_proto::{ - aura::{Aura, AuraTitle}, + aura::AuraTitle, error::GameError, game::{GameSettings, OrRandom, SetupRole, SetupSlot, SlotId}, message::{Identification, PlayerState, PublicIdentity}, diff --git a/werewolves/src/pages/drunk_page.rs b/werewolves/src/pages/drunk_page.rs index 06a0441..92476c0 100644 --- a/werewolves/src/pages/drunk_page.rs +++ b/werewolves/src/pages/drunk_page.rs @@ -1,7 +1,7 @@ use werewolves_proto::aura::AuraTitle; use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType, PartialAssociatedIcon}; +use crate::components::{Icon, IconSource, PartialAssociatedIcon}; #[function_component] pub fn DrunkPage() -> Html { diff --git a/werewolves/src/pages/error.rs b/werewolves/src/pages/error.rs index 65c078c..8d0d09c 100644 --- a/werewolves/src/pages/error.rs +++ b/werewolves/src/pages/error.rs @@ -22,22 +22,20 @@ use crate::clients::client::connection::ConnectionError; #[derive(Debug, Error)] pub enum WerewolfError { #[error("{0}")] - GameError(#[from] GameError), + Game(#[from] GameError), #[error("local storage error: {0}")] - LocalStorageError(String), - #[error("invalid target")] - InvalidTarget, + LocalStorage(String), #[error("send error: {0}")] - SendError(#[from] futures::channel::mpsc::SendError), + Send(#[from] futures::channel::mpsc::SendError), #[error("send error: {0}")] - ClientSendError(#[from] yew::platform::pinned::mpsc::SendError), + ClientSend(#[from] yew::platform::pinned::mpsc::SendError), #[error("connection error: {0}")] - ConnectionError(#[from] ConnectionError), + Connection(#[from] ConnectionError), } impl From for WerewolfError { fn from(storage_error: StorageError) -> Self { - Self::LocalStorageError(storage_error.to_string()) + Self::LocalStorage(storage_error.to_string()) } } diff --git a/werewolves/src/pages/role_change.rs b/werewolves/src/pages/role_change.rs index 83ce8c0..375b5d7 100644 --- a/werewolves/src/pages/role_change.rs +++ b/werewolves/src/pages/role_change.rs @@ -13,13 +13,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . use convert_case::{Case, Casing}; -use werewolves_proto::{ - game::SetupRole, - role::{Alignment, RoleTitle}, -}; +use werewolves_proto::{game::SetupRole, role::RoleTitle}; use yew::prelude::*; -use crate::components::{AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon}; +use crate::components::{Icon, PartialAssociatedIcon}; #[derive(Debug, Clone, Copy, PartialEq, Properties)] pub struct RoleChangePageProps { diff --git a/werewolves/src/pages/role_page/adjudicator.rs b/werewolves/src/pages/role_page/adjudicator.rs index 5a1d97d..720a0fb 100644 --- a/werewolves/src/pages/role_page/adjudicator.rs +++ b/werewolves/src/pages/role_page/adjudicator.rs @@ -15,7 +15,7 @@ use werewolves_proto::role::Killer; use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn AdjudicatorPage1() -> Html { diff --git a/werewolves/src/pages/role_page/empath.rs b/werewolves/src/pages/role_page/empath.rs index 53e9f36..3d0cd61 100644 --- a/werewolves/src/pages/role_page/empath.rs +++ b/werewolves/src/pages/role_page/empath.rs @@ -12,11 +12,10 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::ops::Not; use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn EmpathPage1() -> Html { diff --git a/werewolves/src/pages/role_page/gravedigger.rs b/werewolves/src/pages/role_page/gravedigger.rs index a18c151..a706bec 100644 --- a/werewolves/src/pages/role_page/gravedigger.rs +++ b/werewolves/src/pages/role_page/gravedigger.rs @@ -16,7 +16,7 @@ use convert_case::{Case, Casing}; use werewolves_proto::role::RoleTitle; use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType, PartialAssociatedIcon}; +use crate::components::{Icon, IconSource, PartialAssociatedIcon}; #[function_component] pub fn GravediggerPage1() -> Html { diff --git a/werewolves/src/pages/role_page/guardian.rs b/werewolves/src/pages/role_page/guardian.rs index e088c28..cfe4408 100644 --- a/werewolves/src/pages/role_page/guardian.rs +++ b/werewolves/src/pages/role_page/guardian.rs @@ -15,7 +15,7 @@ use werewolves_proto::message::CharacterIdentity; use yew::prelude::*; -use crate::components::{CharacterTargetCard, Icon, IconSource, IconType}; +use crate::components::{CharacterTargetCard, Icon, IconSource}; #[derive(Debug, Clone, PartialEq, Properties)] pub struct GuardianPageProps { diff --git a/werewolves/src/pages/role_page/hunter.rs b/werewolves/src/pages/role_page/hunter.rs index d3968ea..c339be3 100644 --- a/werewolves/src/pages/role_page/hunter.rs +++ b/werewolves/src/pages/role_page/hunter.rs @@ -14,7 +14,7 @@ // along with this program. If not, see . use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn HunterPage1() -> Html { diff --git a/werewolves/src/pages/role_page/militia.rs b/werewolves/src/pages/role_page/militia.rs index 170aa80..181f1d5 100644 --- a/werewolves/src/pages/role_page/militia.rs +++ b/werewolves/src/pages/role_page/militia.rs @@ -14,7 +14,7 @@ // along with this program. If not, see . use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn MilitiaPage1() -> Html { diff --git a/werewolves/src/pages/role_page/pyremaster.rs b/werewolves/src/pages/role_page/pyremaster.rs index 1fc1b5a..289b71b 100644 --- a/werewolves/src/pages/role_page/pyremaster.rs +++ b/werewolves/src/pages/role_page/pyremaster.rs @@ -14,7 +14,7 @@ // along with this program. If not, see . use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn PyremasterPage1() -> Html { diff --git a/werewolves/src/pages/role_page/seer.rs b/werewolves/src/pages/role_page/seer.rs index 4b20378..05c4f6e 100644 --- a/werewolves/src/pages/role_page/seer.rs +++ b/werewolves/src/pages/role_page/seer.rs @@ -15,9 +15,7 @@ use werewolves_proto::role::{Alignment, RoleTitle}; use yew::prelude::*; -use crate::components::{ - AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon, attributes::RoleTitleSpan, -}; +use crate::components::{AssociatedIcon, Icon, IconSource, IconType, attributes::RoleTitleSpan}; #[function_component] pub fn SeerPage1() -> Html { diff --git a/werewolves/src/pages/role_page/vindicator.rs b/werewolves/src/pages/role_page/vindicator.rs index f8e1e81..c07526f 100644 --- a/werewolves/src/pages/role_page/vindicator.rs +++ b/werewolves/src/pages/role_page/vindicator.rs @@ -14,7 +14,7 @@ // along with this program. If not, see . use yew::prelude::*; -use crate::components::{Icon, IconSource, IconType}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn VindicatorPage1() -> Html { diff --git a/werewolves/src/pages/shift_failed.rs b/werewolves/src/pages/shift_failed.rs index 07cc305..6ff7102 100644 --- a/werewolves/src/pages/shift_failed.rs +++ b/werewolves/src/pages/shift_failed.rs @@ -12,14 +12,9 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use convert_case::{Case, Casing}; -use werewolves_proto::{ - game::SetupRole, - role::{Alignment, RoleTitle}, -}; use yew::prelude::*; -use crate::components::{AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn ShiftFailed() -> Html { diff --git a/werewolves/src/pages/wolf_pack.rs b/werewolves/src/pages/wolf_pack.rs index b4379d5..83a0d5b 100644 --- a/werewolves/src/pages/wolf_pack.rs +++ b/werewolves/src/pages/wolf_pack.rs @@ -12,12 +12,10 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use core::ops::Not; -use werewolves_proto::role::Powerful; use yew::prelude::*; -use crate::components::{AssociatedIcon, Icon, IconSource, IconType}; +use crate::components::{Icon, IconSource}; #[function_component] pub fn WolfpackKillPage() -> Html {