From e9661bea1a3ce9b387a33c98929266742a0559d7 Mon Sep 17 00:00:00 2001 From: Marc-Stefan Cassola Date: Tue, 30 Aug 2022 20:51:21 +0000 Subject: [PATCH] Implemented `Reflect` for all the ranges (#5806) # Objective Fixes #5763 ## Solution Implemented as reflect value like the current `Range`. Is there a benefit to changing everything to a reflect struct? --- crates/bevy_reflect/src/impls/std.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index f89c4855cc..b79858d16c 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -18,7 +18,7 @@ use std::{ NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, }, - ops::Range, + ops::{Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive}, }; impl_reflect_value!(bool(Debug, Hash, PartialEq, Serialize, Deserialize)); @@ -41,6 +41,11 @@ impl_reflect_value!(String(Debug, Hash, PartialEq, Serialize, Deserialize)); impl_reflect_value!(Result()); impl_reflect_value!(HashSet()); impl_reflect_value!(Range()); +impl_reflect_value!(RangeInclusive()); +impl_reflect_value!(RangeFrom()); +impl_reflect_value!(RangeTo()); +impl_reflect_value!(RangeToInclusive()); +impl_reflect_value!(RangeFull()); impl_reflect_value!(Duration(Debug, Hash, PartialEq, Serialize, Deserialize)); impl_reflect_value!(Instant(Debug, Hash, PartialEq)); impl_reflect_value!(NonZeroI128(Debug, Hash, PartialEq, Serialize, Deserialize)); @@ -75,6 +80,11 @@ impl_from_reflect_value!(f64); impl_from_reflect_value!(String); impl_from_reflect_value!(HashSet); impl_from_reflect_value!(Range); +impl_from_reflect_value!(RangeInclusive); +impl_from_reflect_value!(RangeFrom); +impl_from_reflect_value!(RangeTo); +impl_from_reflect_value!(RangeToInclusive); +impl_from_reflect_value!(RangeFull); impl_from_reflect_value!(Duration); impl_from_reflect_value!(Instant); impl_from_reflect_value!(NonZeroI128);