style: format rust
This commit is contained in:
parent
c7879ddc05
commit
e82751e2bf
@ -73,8 +73,7 @@ impl INode2D for Boid2D {
|
||||
}
|
||||
|
||||
fn exit_tree(&mut self) {
|
||||
let mut flock: Gd<Flock2D> =
|
||||
Gd::from_instance_id(self.get_flock_id());
|
||||
let mut flock: Gd<Flock2D> = Gd::from_instance_id(self.get_flock_id());
|
||||
flock.bind_mut().unregister_boid(self.get_id());
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,8 @@ impl Boid3D {
|
||||
#[inline(always)]
|
||||
/// Get the flock ID of this boid.
|
||||
pub fn get_flock_id(&self) -> InstanceId {
|
||||
self.flock_id.expect("no flock id found set... this is a bug!")
|
||||
self.flock_id
|
||||
.expect("no flock id found set... this is a bug!")
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,8 +73,7 @@ impl INode3D for Boid3D {
|
||||
}
|
||||
|
||||
fn exit_tree(&mut self) {
|
||||
let mut flock: Gd<Flock3D> =
|
||||
Gd::from_instance_id(self.get_flock_id());
|
||||
let mut flock: Gd<Flock3D> = Gd::from_instance_id(self.get_flock_id());
|
||||
flock.bind_mut().unregister_boid(self.get_id());
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ use godot::prelude::*;
|
||||
|
||||
use crate::BoidProperties;
|
||||
|
||||
pub mod flock_properties;
|
||||
pub mod flock_2d;
|
||||
pub mod flock_3d;
|
||||
pub mod flock_properties;
|
||||
|
||||
pub use flock_properties::*;
|
||||
pub use flock_2d::*;
|
||||
pub use flock_3d::*;
|
||||
pub use flock_properties::*;
|
||||
|
||||
pub trait Flock {
|
||||
fn get_flock_properties(&self) -> &FlockProperties;
|
||||
|
@ -12,8 +12,8 @@ use rayon::prelude::*;
|
||||
mod boid;
|
||||
mod flock;
|
||||
|
||||
pub use boid::{*, Boid};
|
||||
pub use flock::{*, Flock};
|
||||
pub use boid::{Boid, *};
|
||||
pub use flock::{Flock, *};
|
||||
|
||||
use rustc_hash::FxBuildHasher;
|
||||
|
||||
@ -226,8 +226,10 @@ const fn to_glam_vec(godot_vec: Vector3) -> Vec3 {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn process_boids<F, B>(boids: &mut FxIndexMap<InstanceId, Gd<B>>, flocks: &FxIndexMap<InstanceId, Gd<F>>)
|
||||
where
|
||||
fn process_boids<F, B>(
|
||||
boids: &mut FxIndexMap<InstanceId, Gd<B>>,
|
||||
flocks: &FxIndexMap<InstanceId, Gd<F>>,
|
||||
) where
|
||||
F: Flock + GodotClass,
|
||||
F: Bounds<Declarer = DeclUser>,
|
||||
B: Boid + GodotClass,
|
||||
|
Loading…
Reference in New Issue
Block a user