pub struct GameLoop { /* private fields */ }Expand description
Simple synchronous game loop for turn-based games
Implementations§
Source§impl GameLoop
impl GameLoop
Sourcepub fn with_config(config: GameLoopConfig) -> Self
pub fn with_config(config: GameLoopConfig) -> Self
Create a game loop with custom configuration
Sourcepub async fn run<S: Scene>(
&self,
scene: S,
services: &ServiceContext,
systems: &mut SystemContext,
resources: &mut ResourceContext,
) -> Result<()>
pub async fn run<S: Scene>( &self, scene: S, services: &ServiceContext, systems: &mut SystemContext, resources: &mut ResourceContext, ) -> Result<()>
Run the game loop with a scene and contexts
Returns when SceneTransition::Quit is received
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GameLoop
impl RefUnwindSafe for GameLoop
impl Send for GameLoop
impl Sync for GameLoop
impl Unpin for GameLoop
impl UnsafeUnpin for GameLoop
impl UnwindSafe for GameLoop
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> Component for T
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