--- a/rust/hwphysics/src/lib.rs Fri Nov 13 02:52:15 2020 +0300
+++ b/rust/hwphysics/src/lib.rs Fri Nov 13 20:54:00 2020 +0300
@@ -11,7 +11,7 @@
use crate::{
collision::CollisionProcessor,
common::{GearAllocator, GearId, Millis},
- data::GearDataManager,
+ data::{DataIterator, GearDataManager, TypeIter},
physics::PhysicsProcessor,
time::TimeProcessor,
};
@@ -67,6 +67,11 @@
pub fn add_gear_data<T: Clone + 'static>(&mut self, gear_id: GearId, data: &T) {
self.data.add(gear_id, data);
}
+
+ #[inline]
+ pub fn iter_data<T: TypeIter + 'static>(&mut self) -> DataIterator<T> {
+ self.data.iter()
+ }
}
#[cfg(test)]