cargo fix + warning fixes
This commit is contained in:
parent
99a2fa31c4
commit
ad7ffaac31
|
|
@ -13,8 +13,8 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use quote::{ToTokens, quote};
|
||||
use syn::{parse::Parse, spanned::Spanned};
|
||||
|
||||
use syn::parse::Parse;
|
||||
#[allow(unused)]
|
||||
pub struct RefAndMut {
|
||||
name: syn::Ident,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use core::{num::NonZeroU8, ops::Not};
|
||||
use core::num::NonZeroU8;
|
||||
|
||||
use super::Result;
|
||||
use crate::{
|
||||
|
|
|
|||
|
|
@ -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<T> = core::result::Result<T, GameError>;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use super::Result;
|
||||
use crate::{
|
||||
aura::Aura,
|
||||
character::{Character, CharacterId},
|
||||
diedto::DiedTo,
|
||||
error::GameError,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -12,22 +12,14 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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]
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -12,16 +12,13 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -12,20 +12,13 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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]
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
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]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use core::num::{NonZero, NonZeroU8};
|
||||
use core::num::NonZeroU8;
|
||||
#[allow(unused)]
|
||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||
|
||||
|
|
|
|||
|
|
@ -12,15 +12,13 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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]
|
||||
|
|
|
|||
|
|
@ -12,22 +12,13 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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]
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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<TypedHeader<headers::UserAgent>>,
|
||||
x_forwarded_for: Option<TypedHeader<XForwardedFor>>,
|
||||
ConnectInfo(addr): ConnectInfo<SocketAddr>,
|
||||
State(state): State<AppState>,
|
||||
|
|
@ -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(());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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};
|
||||
|
|
|
|||
|
|
@ -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<CharacterIdentity>, ActionResult),
|
||||
Story {
|
||||
story: GameStory,
|
||||
#[allow(unused)]
|
||||
page: usize,
|
||||
},
|
||||
}
|
||||
|
|
@ -311,7 +312,7 @@ impl Component for Host {
|
|||
fn view(&self, _ctx: &Context<Self>) -> 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) => {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -13,14 +13,10 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use werewolves_proto::role::{self, Killer};
|
||||
use werewolves_proto::role::Killer;
|
||||
use yew::prelude::*;
|
||||
|
||||
use crate::components::{AssociatedIcon, Icon, IconType};
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ use yew::prelude::*;
|
|||
|
||||
use crate::components::{
|
||||
AssociatedIcon, Button, Icon, IconType, Identity, PartialAssociatedIcon,
|
||||
attributes::RoleTitleSpan,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use werewolves_proto::{
|
||||
aura::{Aura, AuraTitle},
|
||||
aura::AuraTitle,
|
||||
diedto::DiedToTitle,
|
||||
role::{Alignment, Killer, Powerful, RoleTitle},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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<ClientMessage>),
|
||||
ClientSend(#[from] yew::platform::pinned::mpsc::SendError<ClientMessage>),
|
||||
#[error("connection error: {0}")]
|
||||
ConnectionError(#[from] ConnectionError),
|
||||
Connection(#[from] ConnectionError),
|
||||
}
|
||||
|
||||
impl From<StorageError> for WerewolfError {
|
||||
fn from(storage_error: StorageError) -> Self {
|
||||
Self::LocalStorageError(storage_error.to_string())
|
||||
Self::LocalStorage(storage_error.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,13 +13,10 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -12,11 +12,10 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use core::ops::Not;
|
||||
|
||||
use yew::prelude::*;
|
||||
|
||||
use crate::components::{Icon, IconSource, IconType};
|
||||
use crate::components::{Icon, IconSource};
|
||||
|
||||
#[function_component]
|
||||
pub fn EmpathPage1() -> Html {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use yew::prelude::*;
|
||||
|
||||
use crate::components::{Icon, IconSource, IconType};
|
||||
use crate::components::{Icon, IconSource};
|
||||
|
||||
#[function_component]
|
||||
pub fn HunterPage1() -> Html {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use yew::prelude::*;
|
||||
|
||||
use crate::components::{Icon, IconSource, IconType};
|
||||
use crate::components::{Icon, IconSource};
|
||||
|
||||
#[function_component]
|
||||
pub fn MilitiaPage1() -> Html {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use yew::prelude::*;
|
||||
|
||||
use crate::components::{Icon, IconSource, IconType};
|
||||
use crate::components::{Icon, IconSource};
|
||||
|
||||
#[function_component]
|
||||
pub fn PyremasterPage1() -> Html {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
use yew::prelude::*;
|
||||
|
||||
use crate::components::{Icon, IconSource, IconType};
|
||||
use crate::components::{Icon, IconSource};
|
||||
|
||||
#[function_component]
|
||||
pub fn VindicatorPage1() -> Html {
|
||||
|
|
|
|||
|
|
@ -12,14 +12,9 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -12,12 +12,10 @@
|
|||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue