rust/hwphysics/src/lib.rs
changeset 15784 84c07aa94b61
parent 15404 701ad89a9f2a
child 15790 704f00889f3a
--- 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)]