summaryrefslogtreecommitdiff
path: root/ecs/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/lib.rs')
-rw-r--r--ecs/src/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs
index 741b555..b920b48 100644
--- a/ecs/src/lib.rs
+++ b/ecs/src/lib.rs
@@ -12,6 +12,7 @@ use std::vec::Drain;
use crate::actions::Action;
use crate::component::storage::Storage as ComponentStorage;
use crate::component::{Component, Id as ComponentId, Sequence as ComponentSequence};
+use crate::entity::Uid as EntityUid;
use crate::event::{Event, Id as EventId, Ids, Sequence as EventSequence};
use crate::extension::{Collector as ExtensionCollector, Extension};
use crate::lock::Lock;
@@ -22,10 +23,12 @@ use crate::type_name::TypeName;
pub mod actions;
pub mod component;
+pub mod entity;
pub mod event;
pub mod extension;
pub mod lock;
pub mod query;
+pub mod relationship;
pub mod sole;
pub mod system;
pub mod tuple;
@@ -57,15 +60,18 @@ impl World
///
/// # Panics
/// Will panic if mutable internal lock cannot be acquired.
- pub fn create_entity<Comps>(&mut self, components: Comps)
+ pub fn create_entity<Comps>(&mut self, components: Comps) -> EntityUid
where
Comps: ComponentSequence,
{
- self.data
+ let (_, entity_uid) = self
+ .data
.component_storage
.write_nonblock()
.expect("Failed to acquire read-write component storage lock")
.push_entity(components.into_vec());
+
+ entity_uid
}
/// Adds a globally shared singleton value.