From b9e93f70ca47352c58345548fc8c667336cc4682 Mon Sep 17 00:00:00 2001 From: Freja Roberts Date: Mon, 12 Feb 2024 00:22:05 +0100 Subject: [PATCH] feat: EntityBuilder::is_empty --- src/entity/builder.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/entity/builder.rs b/src/entity/builder.rs index 57d0b38..f8856a3 100644 --- a/src/entity/builder.rs +++ b/src/entity/builder.rs @@ -194,6 +194,13 @@ impl EntityBuilder { pub fn component_count(&self) -> usize { self.buffer.len() } + + /// Returns true if the builder does not contain any components + #[must_use] + #[inline] + pub fn is_empty(&self) -> bool { + self.buffer.is_empty() + } } impl Default for EntityBuilder {