[−][src]Struct legion::Universe
The Universe
is a factory for creating World
s.
Entities inserted into worlds created within the same universe are guarenteed to have
unique Entity
IDs, even across worlds.
Worlds belonging to the same universe can be safely merged via World.merge
.
Methods
impl Universe
[src]
pub fn new<L: Into<Option<Logger>>>(logger: L) -> Self
[src]
Creates a new Universe
.
Examples
// Create an slog logger let decorator = slog_term::TermDecorator::new().build(); let drain = Mutex::new(slog_term::FullFormat::new(decorator).build()).fuse(); let log = slog::Logger::root(drain, o!()); // Create world with logger let universe = Universe::new(log); // Create world without logger let universe = Universe::new(None);
pub fn create_world(&self) -> World
[src]
Creates a new World
within this Universe
.
Entities inserted into worlds created within the same universe are guarenteed to have
unique Entity
IDs, even across worlds.
Worlds belonging to the same universe can be safely merged via World.merge
.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> EntityData for T where
T: 'static + Send + Sync + Debug,
[src]
T: 'static + Send + Sync + Debug,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Downcast for T where
T: Any,
[src]
T: Any,