use bevy_ecs::{Entity, FromResources};
use bevy_property::Properties;
use std::ops::{Deref, DerefMut};
#[derive(Debug, Copy, Clone, Eq, PartialEq, Properties)]
pub struct Parent(pub Entity);
impl FromResources for Parent {
fn from_resources(_resources: &bevy_ecs::Resources) -> Self {
Parent(Entity::from_id(u32::MAX))
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct PreviousParent(pub Option<Entity>);
impl Deref for Parent {
type Target = Entity;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl DerefMut for Parent {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}