add world.insert passthrough to entitybuilder
This commit is contained in:
parent
cd6ccc45b1
commit
649e1b113f
@ -1,5 +1,5 @@
|
||||
use crate::ecs::EntityArchetype;
|
||||
use legion::prelude::*;
|
||||
use legion::{world::{TagSet, TagLayout, IntoComponentSource}, prelude::*, filter::{Filter, ChunksetFilterData}};
|
||||
|
||||
pub trait EntityBuilderSource {
|
||||
fn build(&mut self) -> EntityBuilder;
|
||||
@ -48,6 +48,15 @@ impl<'a> EntityBuilder<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_entities<T,C>(self, tags: T, components: C) -> Self
|
||||
where
|
||||
T: TagSet + TagLayout + for<'b> Filter<ChunksetFilterData<'b>>,
|
||||
C: IntoComponentSource,
|
||||
{
|
||||
self.world.insert(tags, components);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_archetype(mut self, entity_archetype: impl EntityArchetype) -> Self {
|
||||
self.current_entity = Some(entity_archetype.insert(self.world));
|
||||
self
|
||||
|
||||
Loading…
Reference in New Issue
Block a user