cargo fmt
This commit is contained in:
@@ -145,7 +145,9 @@ impl Harness {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// type StepCallback = FnMut(&mut PhysicsState, &PhysicsEvents, f32);
|
// type StepCallback = FnMut(&mut PhysicsState, &PhysicsEvents, f32);
|
||||||
pub fn add_callback<F: FnMut(&mut PhysicsState, &PhysicsEvents, &HarnessState, f32) + 'static>(
|
pub fn add_callback<
|
||||||
|
F: FnMut(&mut PhysicsState, &PhysicsEvents, &HarnessState, f32) + 'static,
|
||||||
|
>(
|
||||||
&mut self,
|
&mut self,
|
||||||
callback: F,
|
callback: F,
|
||||||
) {
|
) {
|
||||||
@@ -196,16 +198,11 @@ impl Harness {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for f in &mut self.callbacks {
|
for f in &mut self.callbacks {
|
||||||
f(
|
f(&mut self.physics, &self.events, &self.state, self.time)
|
||||||
&mut self.physics,
|
|
||||||
&self.events,
|
|
||||||
&self.state,
|
|
||||||
self.time,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for plugin in &mut self.plugins {
|
for plugin in &mut self.plugins {
|
||||||
plugin.run_callbacks(&mut self.physics, &self.events,&self.state, self.time)
|
plugin.run_callbacks(&mut self.physics, &self.events, &self.state, self.time)
|
||||||
}
|
}
|
||||||
|
|
||||||
self.events.poll_all();
|
self.events.poll_all();
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
use crate::harness::HarnessState;
|
use crate::harness::HarnessState;
|
||||||
use crate::PhysicsState;
|
|
||||||
use crate::physics::PhysicsEvents;
|
use crate::physics::PhysicsEvents;
|
||||||
|
use crate::PhysicsState;
|
||||||
|
|
||||||
pub trait HarnessPlugin {
|
pub trait HarnessPlugin {
|
||||||
//FIXME: is run_callbacks needed?
|
//FIXME: is run_callbacks needed?
|
||||||
fn run_callbacks(&mut self, physics: &mut PhysicsState, events: &PhysicsEvents, harness_state: &HarnessState, t: f32);
|
fn run_callbacks(
|
||||||
|
&mut self,
|
||||||
|
physics: &mut PhysicsState,
|
||||||
|
events: &PhysicsEvents,
|
||||||
|
harness_state: &HarnessState,
|
||||||
|
t: f32,
|
||||||
|
);
|
||||||
fn step(&mut self, physics: &mut PhysicsState);
|
fn step(&mut self, physics: &mut PhysicsState);
|
||||||
fn profiling_string(&self) -> String;
|
fn profiling_string(&self) -> String;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ extern crate bitflags;
|
|||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
pub use crate::engine::GraphicsManager;
|
pub use crate::engine::GraphicsManager;
|
||||||
pub use crate::physics::PhysicsState;
|
|
||||||
pub use crate::harness::plugin::HarnessPlugin;
|
pub use crate::harness::plugin::HarnessPlugin;
|
||||||
|
pub use crate::physics::PhysicsState;
|
||||||
pub use crate::plugin::TestbedPlugin;
|
pub use crate::plugin::TestbedPlugin;
|
||||||
pub use crate::testbed::Testbed;
|
pub use crate::testbed::Testbed;
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,3 @@ pub trait TestbedPlugin {
|
|||||||
fn draw(&mut self);
|
fn draw(&mut self);
|
||||||
fn profiling_string(&self) -> String;
|
fn profiling_string(&self) -> String;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user