mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
rename entitybuilder to worldbuilder
This commit is contained in:
parent
649e1b113f
commit
edf57c0dd3
3 changed files with 10 additions and 10 deletions
|
@ -1,9 +1,9 @@
|
|||
pub mod default_archetypes;
|
||||
mod entity_archetype;
|
||||
mod entity_builder;
|
||||
mod world_builder;
|
||||
|
||||
pub use entity_archetype::*;
|
||||
pub use entity_builder::*;
|
||||
pub use world_builder::*;
|
||||
|
||||
use bevy_transform::prelude::Children;
|
||||
use legion::{
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
use crate::ecs::EntityArchetype;
|
||||
use legion::{world::{TagSet, TagLayout, IntoComponentSource}, prelude::*, filter::{Filter, ChunksetFilterData}};
|
||||
|
||||
pub trait EntityBuilderSource {
|
||||
fn build(&mut self) -> EntityBuilder;
|
||||
pub trait WorldBuilderSource {
|
||||
fn build(&mut self) -> WorldBuilder;
|
||||
}
|
||||
|
||||
impl EntityBuilderSource for World {
|
||||
fn build(&mut self) -> EntityBuilder {
|
||||
EntityBuilder {
|
||||
impl WorldBuilderSource for World {
|
||||
fn build(&mut self) -> WorldBuilder {
|
||||
WorldBuilder {
|
||||
world: self,
|
||||
current_entity: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EntityBuilder<'a> {
|
||||
pub struct WorldBuilder<'a> {
|
||||
world: &'a mut World,
|
||||
current_entity: Option<Entity>,
|
||||
}
|
||||
|
||||
impl<'a> EntityBuilder<'a> {
|
||||
impl<'a> WorldBuilder<'a> {
|
||||
pub fn build_entity(mut self) -> Self {
|
||||
let entity = *self.world.insert((), vec![()]).first().unwrap();
|
||||
self.current_entity = Some(entity);
|
|
@ -3,7 +3,7 @@ pub use crate::{
|
|||
asset::{Asset, AssetStorage, Handle, Mesh, MeshType, Texture, TextureType},
|
||||
core::Time,
|
||||
ecs,
|
||||
ecs::{default_archetypes::*, EntityArchetype, EntityBuilder, EntityBuilderSource},
|
||||
ecs::{default_archetypes::*, EntityArchetype, WorldBuilder, WorldBuilderSource},
|
||||
render::{
|
||||
ActiveCamera, ActiveCamera2d, Albedo, Camera, CameraType, Instanced, Light, Material,
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue