diff options
| author | HampusM <hampus@hampusmat.com> | 2026-07-10 13:30:15 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-07-10 13:30:15 +0200 |
| commit | e7fa00a81d158f17736d1a66c1bd4b304969f3e5 (patch) | |
| tree | 4e18c34e7f2f26cdeefa8e3dd5b72da551e5fa6b | |
| parent | 8345bc48223e21c200d7f0a53ec4c9482bceeedb (diff) | |
feat(engine-ecs): add declaring multiple entities with declare_entity
| -rw-r--r-- | engine-ecs/src/entity.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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); + }); + )+ } } |
