0.1.0-0-pre.11-fix.5
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
// file: crates/engines/engine-v1-common/src/game_loop.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
/// Minimal update contract implemented by a game state consumed by engine V1.
|
||||
pub trait EngineGame {
|
||||
/// Advances the game by one engine update using platform-independent input.
|
||||
fn update(&mut self, frame: crate::EngineFrame, input: crate::InputState);
|
||||
|
||||
/// Handles a platform-independent request to leave the current runtime.
|
||||
///
|
||||
/// Games may mutate their state and return [`crate::QuitDecision::Continue`] to implement
|
||||
/// pause/confirmation screens, navigation, score submission, saving, or other workflows.
|
||||
fn quit_requested(&mut self, _request: crate::QuitRequest) -> crate::QuitDecision {
|
||||
return crate::QuitDecision::Exit;
|
||||
}
|
||||
|
||||
/// Produces the platform-independent scene rendered after the update.
|
||||
fn scene(&self) -> crate::EngineScene {
|
||||
return crate::EngineScene::empty(crate::RenderColor::rgb(18, 18, 24));
|
||||
|
||||
Reference in New Issue
Block a user