diff --git a/src/gameplay_attributes.rs b/src/gameplay_attributes.rs index 064bbcb..f600ab3 100644 --- a/src/gameplay_attributes.rs +++ b/src/gameplay_attributes.rs @@ -150,23 +150,24 @@ impl IntersectingAttributes{ } #[derive(Clone,Copy,id::Id,Hash,Eq,PartialEq)] pub struct CollisionAttributesId(u32); +#[derive(Clone,Default,Hash,Eq,PartialEq)] +pub struct ContactAttributes{ + pub contacting:ContactingAttributes, + pub general:GeneralAttributes, +} +#[derive(Clone,Default,Hash,Eq,PartialEq)] +pub struct IntersectAttributes{ + pub intersecting:IntersectingAttributes, + pub general:GeneralAttributes, +} #[derive(Clone,Hash,Eq,PartialEq)] pub enum CollisionAttributes{ Decoration,//visual only - Contact{//track whether you are contacting the object - contacting:ContactingAttributes, - general:GeneralAttributes, - }, - Intersect{//track whether you are intersecting the object - intersecting:IntersectingAttributes, - general:GeneralAttributes, - }, + Contact(ContactAttributes),//track whether you are contacting the object + Intersect(IntersectAttributes),//track whether you are intersecting the object } impl CollisionAttributes{ pub fn contact_default()->Self{ - Self::Contact{ - contacting:ContactingAttributes::default(), - general:GeneralAttributes::default() - } + Self::Contact(ContactAttributes::default()) } }