#[non_exhaustive]pub struct Setup {
pub display: DisplayInfo,
pub storage: Box<dyn Storage>,
pub seed: u64,
pub voice_manifest: Option<String>,
pub platform: PlatformFacts,
pub key_prompt: KeyPrompt,
pub last_crash: Option<LastCrash>,
}Expand description
What the platform gives a game as it loads: what goes into its context
(ctx). A backend with more to give (the voice manifest it
read) adds it with Start::before_load.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.display: DisplayInfoThe display, for a game that picks its console to fit it.
storage: Box<dyn Storage>Where the game’s saves and settings persist (Platform::storage).
seed: u64A seed from the clock, different each launch: the music’s random picks, and a game’s own luck where it wants that.
voice_manifest: Option<String>The text of the voice manifest the backend read, if it found one.
platform: PlatformFactsWhere the game runs: the target’s id, whether the game may quit,
whether its window goes full screen, and the keyboard, pointer and
touch screen the device has (Platform::facts).
key_prompt: KeyPromptWhether the game waits for a first key press (browsers block sound
until one): KeyPrompt::Waiting unless the backend says not.
last_crash: Option<LastCrash>The last crash, if the game hasn’t heard of it: the newest report in
storage newer than the last one offered
(crash::offer_last_crash), so each is offered once. What the
player sees of it, if anything, is the game’s to word.
Implementations§
Source§impl Setup
impl Setup
Sourcepub fn ctx<G: GameData>(self, ctx: Ctx<G>) -> Ctx<G>
pub fn ctx<G: GameData>(self, ctx: Ctx<G>) -> Ctx<G>
ctx on this platform: its saves and settings in the platform’s
storage, the voices the voice manifest allows, idle motion on, the
platform’s facts and the key prompt the backend says, and the music
seeded from the clock so each launch picks differently.