use bevy::prelude::*; use bevy::utils::HashSet; #[derive(Debug, Default, Component)] pub struct ActionObserverMap { pub observers: HashSet, pub _phantom: std::marker::PhantomData, } impl ActionObserverMap { pub fn new(observers: impl IntoIterator) -> Self { Self { observers: observers.into_iter().collect(), _phantom: Default::default(), } } } impl ActionObserverMap { } impl Clone for ActionObserverMap { fn clone(&self) -> Self { Self { observers: self.observers.clone(), _phantom: Default::default(), } } }