Struct oxygengine_core::ecs::Universe
source · [−]pub struct Universe { /* private fields */ }
Implementations
sourceimpl Universe
impl Universe
pub fn new<S>(state: S) -> Self where
S: State + 'static,
pub fn world(&self) -> Ref<'_, World>
pub fn world_mut(&self) -> RefMut<'_, World>
pub fn try_world(&self) -> Option<Ref<'_, World>>
pub fn try_world_mut(&self) -> Option<RefMut<'_, World>>
pub fn commands(&self) -> UniverseCommands
pub fn insert_resource<T>(&mut self, resource: T) where
T: 'static + Send + Sync,
sourcepub unsafe fn insert_resource_raw(
&mut self,
as_type: TypeId,
resource: Box<Resource>
)
pub unsafe fn insert_resource_raw(
&mut self,
as_type: TypeId,
resource: Box<Resource>
)
Safety
This function assume that as_type
matches exactly the type of resource
, you can call it
for example if you want to move already prepared resources from another place to this
universe (in this case we can be sure type IDs matches the types of resources).
pub fn remove_resource<T>(&mut self) where
T: 'static,
pub fn has_resource<T>(&self) -> bool where
T: 'static,
pub fn resource<T>(&self) -> Option<ResRead<T>> where
T: 'static,
pub fn resource_mut<T>(&self) -> Option<ResWrite<T>> where
T: 'static,
pub fn expect_resource<T>(&self) -> ResRead<T> where
T: 'static,
pub fn expect_resource_mut<T>(&self) -> ResWrite<T> where
T: 'static,
pub fn query_resources<T>(&self) -> T::Fetch where
T: ResQuery,
pub fn is_running(&self) -> bool
pub fn maintain(&mut self)
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more