From 7890afa788ea2a366e2e8fe42bf17b132d2b3dcc Mon Sep 17 00:00:00 2001 From: rewin Date: Sat, 9 Dec 2023 00:43:01 +0300 Subject: [PATCH] cargo fmt --- Cargo.toml | 1 - src/debug_diagnostic.rs | 12 +++- src/finish_screen.rs | 23 ++++--- src/level_ui.rs | 2 +- src/lib.rs | 53 +++++++++------- src/menu.rs | 90 ++++++++++++++-------------- src/physics.rs | 7 ++- src/player.rs | 5 +- src/safe_area.rs | 4 +- src/sheep.rs | 22 +++++-- src/storyteller.rs | 37 ++++++------ src/test_level.rs | 56 ++++++++--------- src/wolf.rs | 130 ++++++++++++++++++++++------------------ 13 files changed, 244 insertions(+), 198 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4900d16..53bd820 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,6 @@ dev = [ "bevy/dynamic_linking", "dep:bevy-inspector-egui" ] -default = ["dev"] # All of Bevy's default features exept for the audio related ones (bevy_audio, vorbis), since they clash with bevy_kira_audio # and android_shared_stdcxx, since that is covered in `mobile` diff --git a/src/debug_diagnostic.rs b/src/debug_diagnostic.rs index e0a0163..5fa889b 100644 --- a/src/debug_diagnostic.rs +++ b/src/debug_diagnostic.rs @@ -18,7 +18,10 @@ impl Plugin for DiagnosticPlugin { ) .chain(), ) - .add_systems(Update, (fps_counting, sheep_counter_text).in_set(GameSet::Playing)); + .add_systems( + Update, + (fps_counting, sheep_counter_text).in_set(GameSet::Playing), + ); #[cfg(debug_assertions)] { @@ -95,9 +98,12 @@ pub fn setup_sheep_counter(mut commands: Commands, panels: Query>, sheep_counter: Res, - start_sheep_count: Res + start_sheep_count: Res, ) { for mut text in &mut query { - text.sections[0].value = format!("Sheep in safe area: {}/{}", sheep_counter.count, start_sheep_count.0); + text.sections[0].value = format!( + "Sheep in safe area: {}/{}", + sheep_counter.count, start_sheep_count.0 + ); } } diff --git a/src/finish_screen.rs b/src/finish_screen.rs index 1dc5ebf..f2886e7 100644 --- a/src/finish_screen.rs +++ b/src/finish_screen.rs @@ -1,6 +1,9 @@ use bevy::prelude::*; -use crate::{GameState, storyteller::{Score, FailReason}, GameSet}; +use crate::{ + storyteller::{FailReason, Score}, + GameSet, GameState, +}; pub struct FinishScreenPlugin; @@ -16,11 +19,7 @@ impl Plugin for FinishScreenPlugin { #[derive(Component)] struct FinishScreen; -fn setup_finish_screen( - mut commands: Commands, - score : Res, - fail : Option> -) { +fn setup_finish_screen(mut commands: Commands, score: Res, fail: Option>) { let mut text_style = TextStyle::default(); text_style.font_size = 24.0; @@ -71,10 +70,7 @@ fn setup_finish_screen( }); } -fn cleanup_finish_screen( - mut commands: Commands, - query: Query> -) { +fn cleanup_finish_screen(mut commands: Commands, query: Query>) { for entity in query.iter() { commands.entity(entity).despawn_recursive(); } @@ -82,7 +78,10 @@ fn cleanup_finish_screen( fn finish_screen_system( mut next_state: ResMut>, - mut interaction_query: Query<(&Interaction, &mut BackgroundColor), (Changed, With