pub struct World {
pub entities_and_components: EntitiesAndComponents,
/* private fields */
}Expand description
This struct is the main struct for the game engine
Fields§
§entities_and_components: EntitiesAndComponentsThis struct holds all the entities and components in the game engine
Implementations§
Source§impl World
impl World
Sourcepub fn add_system<T: System + Send + Sync + 'static>(
&mut self,
system: T,
) -> SystemHandle
pub fn add_system<T: System + Send + Sync + 'static>( &mut self, system: T, ) -> SystemHandle
Adds a system to the world
Sourcepub fn remove_system(&mut self, system: SystemHandle)
pub fn remove_system(&mut self, system: SystemHandle)
Removes a system from the world based on the SystemHandle
Sourcepub fn remove_all_systems_of_type<T: System + Send + Sync + 'static>(&mut self)
pub fn remove_all_systems_of_type<T: System + Send + Sync + 'static>(&mut self)
Removes all systems of a certain type from the world O(n) where n is the number of systems
Sourcepub fn remove_all_systems(&mut self)
pub fn remove_all_systems(&mut self)
Removes all systems from the world
Trait Implementations§
Auto Trait Implementations§
impl Freeze for World
impl !RefUnwindSafe for World
impl !Send for World
impl !Sync for World
impl Unpin for World
impl !UnwindSafe for World
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more