mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
implement Debug for Flags regardless of underlying type (#1323)
This commit is contained in:
parent
528c2858e0
commit
f3306e5490
1 changed files with 10 additions and 1 deletions
|
@ -131,13 +131,22 @@ impl<T: WorldQuery> WorldQuery for Option<T> {
|
|||
}
|
||||
|
||||
/// Flags on component `T` that happened since the start of the frame.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Flags<T: Component> {
|
||||
_marker: std::marker::PhantomData<T>,
|
||||
with: bool,
|
||||
added: bool,
|
||||
mutated: bool,
|
||||
}
|
||||
impl<T: Component> std::fmt::Debug for Flags<T> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("Flags")
|
||||
.field("with", &self.with)
|
||||
.field("added", &self.added)
|
||||
.field("mutated", &self.mutated)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Component> Flags<T> {
|
||||
/// Does the entity have this component
|
||||
|
|
Loading…
Reference in a new issue