chore(): a bit of cargo fmt

This commit is contained in:
kaosat.dev 2024-07-18 23:34:10 +02:00
parent b5170c0236
commit f4dd0e59a5
4 changed files with 19 additions and 19 deletions

View File

@ -296,7 +296,7 @@ pub(crate) fn spawn_from_blueprints(
Animations { Animations {
named_animations, named_animations,
named_indices, named_indices,
graph graph,
}, },
Spawned, Spawned,
OriginalChildren(original_children), OriginalChildren(original_children),

View File

@ -108,15 +108,15 @@ pub fn animation_change_on_proximity_foxes(
anim_name = "Survey"; anim_name = "Survey";
} }
// now play the animation based on the chosen animation name // now play the animation based on the chosen animation name
let (mut animation_player, mut animation_transitions) = animation_players.get_mut(link.0).unwrap(); let (mut animation_player, mut animation_transitions) =
animation_players.get_mut(link.0).unwrap();
animation_transitions animation_transitions
.play( .play(
&mut animation_player, &mut animation_player,
*animations *animations
.named_indices .named_indices
.get(anim_name) .get(anim_name)
.expect("animation name should be in the list") .expect("animation name should be in the list"),
,
Duration::from_secs(3), Duration::from_secs(3),
) )
.repeat(); .repeat();
@ -147,15 +147,15 @@ pub fn animation_change_on_proximity_robots(
} }
// now play the animation based on the chosen animation name // now play the animation based on the chosen animation name
let (mut animation_player, mut animation_transitions) = animation_players.get_mut(link.0).unwrap(); let (mut animation_player, mut animation_transitions) =
animation_players.get_mut(link.0).unwrap();
animation_transitions animation_transitions
.play( .play(
&mut animation_player, &mut animation_player,
*animations *animations
.named_indices .named_indices
.get(anim_name) .get(anim_name)
.expect("animation name should be in the list") .expect("animation name should be in the list"),
,
Duration::from_secs(3), Duration::from_secs(3),
) )
.repeat(); .repeat();
@ -175,7 +175,8 @@ pub fn animation_control(
// robots // robots
if keycode.just_pressed(KeyCode::KeyB) { if keycode.just_pressed(KeyCode::KeyB) {
for (link, animations) in animated_enemies.iter() { for (link, animations) in animated_enemies.iter() {
let (mut animation_player, mut animation_transitions) = animation_players.get_mut(link.0).unwrap(); let (mut animation_player, mut animation_transitions) =
animation_players.get_mut(link.0).unwrap();
let anim_name = "Scan"; let anim_name = "Scan";
animation_transitions animation_transitions
.play( .play(
@ -183,8 +184,7 @@ pub fn animation_control(
*animations *animations
.named_indices .named_indices
.get(anim_name) .get(anim_name)
.expect("animation name should be in the list") .expect("animation name should be in the list"),
,
Duration::from_secs(5), Duration::from_secs(5),
) )
.repeat(); .repeat();
@ -194,7 +194,8 @@ pub fn animation_control(
// foxes // foxes
if keycode.just_pressed(KeyCode::KeyW) { if keycode.just_pressed(KeyCode::KeyW) {
for (link, animations) in animated_foxes.iter() { for (link, animations) in animated_foxes.iter() {
let (mut animation_player, mut animation_transitions) = animation_players.get_mut(link.0).unwrap(); let (mut animation_player, mut animation_transitions) =
animation_players.get_mut(link.0).unwrap();
let anim_name = "Walk"; let anim_name = "Walk";
animation_transitions animation_transitions
.play( .play(
@ -211,7 +212,8 @@ pub fn animation_control(
if keycode.just_pressed(KeyCode::KeyX) { if keycode.just_pressed(KeyCode::KeyX) {
for (link, animations) in animated_foxes.iter() { for (link, animations) in animated_foxes.iter() {
let (mut animation_player, mut animation_transitions) = animation_players.get_mut(link.0).unwrap(); let (mut animation_player, mut animation_transitions) =
animation_players.get_mut(link.0).unwrap();
let anim_name = "Run"; let anim_name = "Run";
animation_transitions animation_transitions
.play( .play(
@ -219,8 +221,7 @@ pub fn animation_control(
*animations *animations
.named_indices .named_indices
.get(anim_name) .get(anim_name)
.expect("animation name should be in the list") .expect("animation name should be in the list"),
,
Duration::from_secs(5), Duration::from_secs(5),
) )
.repeat(); .repeat();
@ -229,7 +230,8 @@ pub fn animation_control(
if keycode.just_pressed(KeyCode::KeyC) { if keycode.just_pressed(KeyCode::KeyC) {
for (link, animations) in animated_foxes.iter() { for (link, animations) in animated_foxes.iter() {
let (mut animation_player, mut animation_transitions) = animation_players.get_mut(link.0).unwrap(); let (mut animation_player, mut animation_transitions) =
animation_players.get_mut(link.0).unwrap();
let anim_name = "Survey"; let anim_name = "Survey";
animation_transitions animation_transitions
.play( .play(
@ -237,8 +239,7 @@ pub fn animation_control(
*animations *animations
.named_indices .named_indices
.get(anim_name) .get(anim_name)
.expect("animation name should be in the list") .expect("animation name should be in the list"),
,
Duration::from_secs(5), Duration::from_secs(5),
) )
.repeat(); .repeat();

View File

@ -3,7 +3,6 @@ use bevy::render::mesh::PrimitiveTopology;
// TAKEN VERBATIB FROM https://github.com/janhohenheim/foxtrot/blob/src/util/trait_extension.rs // TAKEN VERBATIB FROM https://github.com/janhohenheim/foxtrot/blob/src/util/trait_extension.rs
pub(crate) trait MeshExt { pub(crate) trait MeshExt {
fn search_in_children<'a>( fn search_in_children<'a>(
parent: Entity, parent: Entity,
children: &'a Query<&Children>, children: &'a Query<&Children>,