From e7fa00a81d158f17736d1a66c1bd4b304969f3e5 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 10 Jul 2026 13:30:15 +0200 Subject: feat(engine-ecs): add declaring multiple entities with declare_entity --- engine-ecs/src/entity.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engine-ecs') diff --git a/engine-ecs/src/entity.rs b/engine-ecs/src/entity.rs index b9829e1..db59301 100644 --- a/engine-ecs/src/entity.rs +++ b/engine-ecs/src/entity.rs @@ -322,6 +322,16 @@ macro_rules! declare_entity { $crate::entity::Declaration::new(|world| { world.spawn_with_uid(*$ident, $components); }); + }; + + ($($(#[$attr: meta])* $visibility: vis $ident: ident: $components: expr;)+) => { + $( + $(#[$attr])* + $visibility static $ident: $crate::entity::Declaration = + $crate::entity::Declaration::new(|world| { + world.spawn_with_uid(*$ident, $components); + }); + )+ } } -- cgit v1.2.3-18-g5258