Struct bones_lib::GameSystems
source · pub struct GameSystems {
pub has_run_startup: bool,
pub startup: Vec<GameSystem>,
pub before: Vec<GameSystem>,
pub after: Vec<GameSystem>,
pub after_session: HashMap<Ustr, Vec<GameSystem>>,
pub before_session: HashMap<Ustr, Vec<GameSystem>>,
}
Fields§
§has_run_startup: bool
Flag which indicates whether or not the startup systems have been run yet.
startup: Vec<GameSystem>
Startup systems.
before: Vec<GameSystem>
Game systems that are run before sessions are run.
after: Vec<GameSystem>
Game systems that are run after sessions are run.
after_session: HashMap<Ustr, Vec<GameSystem>>
Game systems that are run after a specific session is run.
before_session: HashMap<Ustr, Vec<GameSystem>>
Game systems that are run before a specific session is run.
Implementations§
source§impl GameSystems
impl GameSystems
sourcepub fn add_startup_system<F>(&mut self, system: F) -> &mut Self
pub fn add_startup_system<F>(&mut self, system: F) -> &mut Self
Add a system that will run only once, before all of the other non-startup systems.
sourcepub fn add_before_system<F>(&mut self, system: F) -> &mut Self
pub fn add_before_system<F>(&mut self, system: F) -> &mut Self
Add a system that will run on every step, before all of the sessions are run.
sourcepub fn add_after_system<F>(&mut self, system: F) -> &mut Self
pub fn add_after_system<F>(&mut self, system: F) -> &mut Self
Add a system that will run on every step, after all of the sessions are run.
sourcepub fn add_before_session_system<F>(
&mut self,
session: &str,
system: F,
) -> &mut Self
pub fn add_before_session_system<F>( &mut self, session: &str, system: F, ) -> &mut Self
Add a system that will run every time the named session is run, before the session is run.
Trait Implementations§
source§impl Default for GameSystems
impl Default for GameSystems
source§fn default() -> GameSystems
fn default() -> GameSystems
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GameSystems
impl !RefUnwindSafe for GameSystems
impl Send for GameSystems
impl Sync for GameSystems
impl Unpin for GameSystems
impl !UnwindSafe for GameSystems
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
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &World) -> T
fn from_world(_world: &World) -> T
Creates
Self
using data from the given World
.