mirror of https://github.com/hannobraun/Fornjot
parent
9cded04202
commit
496a693f86
|
@ -6,12 +6,10 @@ mod api;
|
|||
mod local;
|
||||
mod object;
|
||||
mod stores;
|
||||
mod update;
|
||||
|
||||
pub use self::{
|
||||
api::Shape,
|
||||
local::LocalForm,
|
||||
object::Object,
|
||||
stores::{Handle, Iter},
|
||||
update::Update,
|
||||
};
|
||||
|
|
|
@ -81,15 +81,6 @@ impl<T: Object> Store<T> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn update<F>(&mut self, mut f: F)
|
||||
where
|
||||
F: FnMut(&mut T),
|
||||
{
|
||||
for (_, object) in self.objects.write().iter_mut() {
|
||||
f(object);
|
||||
}
|
||||
}
|
||||
|
||||
fn ptr(&self) -> *const () {
|
||||
Arc::as_ptr(&self.objects) as _
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
use super::{stores::Stores, Object};
|
||||
|
||||
/// API to update a `Shape`
|
||||
///
|
||||
/// See [`Shape::update`].
|
||||
pub struct Update<'r> {
|
||||
stores: &'r mut Stores,
|
||||
}
|
||||
|
||||
impl<'r> Update<'r> {
|
||||
/// Update all objects of a specific type
|
||||
pub fn update_all<T: Object>(self, f: impl FnMut(&mut T)) -> Self {
|
||||
self.stores.get::<T>().update(f);
|
||||
self
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue