pub struct SystemStore<E, Ctx>where
E: EntityStore,{
pub priorities: BTreeMap<i32, Vec<u32>>,
/* private fields */
}
Expand description
The SystemStore represents the main system storage.
Fields§
§priorities: BTreeMap<i32, Vec<u32>>
Priorities of the systems.
Implementations§
Source§impl<E, Ctx> SystemStore<E, Ctx>where
E: EntityStore,
impl<E, Ctx> SystemStore<E, Ctx>where
E: EntityStore,
Sourcepub fn register_init_system(&mut self, init_system: impl System<E, Ctx>)
pub fn register_init_system(&mut self, init_system: impl System<E, Ctx>)
Registers the init system.
Sourcepub fn register_cleanup_system(&mut self, cleanup_system: impl System<E, Ctx>)
pub fn register_cleanup_system(&mut self, cleanup_system: impl System<E, Ctx>)
Registers the cleanup system.
Sourcepub fn register_system(&mut self, system: impl System<E, Ctx>, system_id: u32)
pub fn register_system(&mut self, system: impl System<E, Ctx>, system_id: u32)
Registers a new system
.
Sourcepub fn remove_system(&mut self, system_id: u32)
pub fn remove_system(&mut self, system_id: u32)
Removes a system from the storage.
Sourcepub fn register_priority(&mut self, priority: Priority, system_id: u32)
pub fn register_priority(&mut self, priority: Priority, system_id: u32)
Register a priority
for the system with the given system_id
.
Sourcepub fn borrow_entity_system(
&self,
entity_system_id: u32,
) -> Result<&EntitySystem<E, Ctx>, NotFound>
pub fn borrow_entity_system( &self, entity_system_id: u32, ) -> Result<&EntitySystem<E, Ctx>, NotFound>
Returns a reference of a entity system. If the entity system does not exists NotFound
will be returned.
Sourcepub fn borrow_init_system(&self) -> &Option<EntitySystem<E, Ctx>>
pub fn borrow_init_system(&self) -> &Option<EntitySystem<E, Ctx>>
Returns a reference of the init entity system. If the init entity system does not exists None
will be returned.
Sourcepub fn borrow_cleanup_system(&self) -> &Option<EntitySystem<E, Ctx>>
pub fn borrow_cleanup_system(&self) -> &Option<EntitySystem<E, Ctx>>
Returns a reference of the cleanup entity system. If the init entity system does not exists None
will be returned.
Trait Implementations§
Source§impl<E, Ctx: Default> Default for SystemStore<E, Ctx>where
E: EntityStore + Default,
impl<E, Ctx: Default> Default for SystemStore<E, Ctx>where
E: EntityStore + Default,
Source§fn default() -> SystemStore<E, Ctx>
fn default() -> SystemStore<E, Ctx>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<E, Ctx> Freeze for SystemStore<E, Ctx>
impl<E, Ctx> !RefUnwindSafe for SystemStore<E, Ctx>
impl<E, Ctx> !Send for SystemStore<E, Ctx>
impl<E, Ctx> !Sync for SystemStore<E, Ctx>
impl<E, Ctx> Unpin for SystemStore<E, Ctx>
impl<E, Ctx> !UnwindSafe for SystemStore<E, Ctx>
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