Struct oxygengine_core::ecs::Universe
source · [−]pub struct Universe {
pub paused_systems_execution: bool,
/* private fields */
}
Fields
paused_systems_execution: bool
Implementations
sourceimpl Universe
impl Universe
pub fn new<S>(state: S) -> Selfwhere
S: State + 'static,
pub fn world(&self) -> RwLockReadGuard<'_, World>
pub fn world_mut(&self) -> RwLockWriteGuard<'_, World>
pub fn try_world(&self) -> Option<RwLockReadGuard<'_, World>>
pub fn try_world_mut(&self) -> Option<RwLockWriteGuard<'_, World>>
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) -> boolwhere
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::Fetchwhere
T: ResQuery,
pub fn is_running(&self) -> bool
pub fn maintain(&mut self)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Universe
impl Send for Universe
impl Sync for Universe
impl Unpin for Universe
impl !UnwindSafe for Universe
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more