use {
crate::ToSignal,
bevy::reflect::{TypePath, TypeUuid},
std::marker::PhantomData,
};
#[derive(TypeUuid, TypePath, Default)]
#[uuid = "6bcf912a-91d0-46d3-bd55-e81123bbc591"]
pub struct Constant<T> {
_phantom: PhantomData<T>,
}
impl<T> Constant<T> {
#[must_use]
pub fn new() -> Self {
Self {
_phantom: PhantomData,
}
}
}
pub struct Settings<T> {
frame: T,
}
impl<T> Settings<T> {
pub fn new(frame: T) -> Self {
Self { frame }
}
}
impl<T: Send + Sync + Clone> ToSignal for Constant<T> {
type Settings = Settings<T>;
type Signal = oddio::Constant<T>;
fn to_signal(&self, settings: Self::Settings) -> Self::Signal {
oddio::Constant::new(settings.frame)
}
}