#[non_exhaustive]pub struct Start<G: GameData> {
pub card: Card,
pub load: Load<G>,
pub look: LookOf<G>,
pub on_system: Option<SystemHook<G>>,
pub made: Option<Made>,
pub state_hash: Option<GameHash<G>>,
pub crash_record: Option<CrashRecord<G>>,
}Expand description
How a game starts: the card shown while it loads, the load, where its
look is and its hook for the system’s events. Built with Start::new,
its optional parts set by the methods named for them (ADR-0039).
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.card: CardWhat the first frame shows.
load: Load<G>Runs on the second frame, the card on the screen.
look: LookOf<G>What the game’s frames are painted with.
on_system: Option<SystemHook<G>>The game’s hook for the system’s events, if it has one.
made: Option<Made>The build’s stamp, copied into a session record.
state_hash: Option<GameHash<G>>The game’s own state hash, in each frame’s hash.
crash_record: Option<CrashRecord<G>>The game’s record of its play, for a crash report.
Implementations§
Source§impl<G: GameData> Start<G>
impl<G: GameData> Start<G>
Sourcepub fn new(
card: Card,
look: LookOf<G>,
load: impl FnOnce(Setup) -> Result<Game<G>, String> + 'static,
) -> Self
pub fn new( card: Card, look: LookOf<G>, load: impl FnOnce(Setup) -> Result<Game<G>, String> + 'static, ) -> Self
A game that shows card, then loads with load, painted with what
look finds in its data.
Sourcepub fn on_system(self, hook: SystemHook<G>) -> Self
pub fn on_system(self, hook: SystemHook<G>) -> Self
The same start with the game’s hook for the system’s events.
Sourcepub fn made(self, made: Made) -> Self
pub fn made(self, made: Made) -> Self
The same start with the build’s stamp, copied into a session record
and checked when one is played (session::prepare).
Sourcepub fn state_hash(self, hash: GameHash<G>) -> Self
pub fn state_hash(self, hash: GameHash<G>) -> Self
The same start with the game’s own state hash, in each frame’s hash
(App::frame_hash): so a playback that plays differently is found
at the frame the game’s state moved, not only when a screen or a
sound shows it.
Sourcepub fn crash_record(self, hook: CrashRecord<G>) -> Self
pub fn crash_record(self, hook: CrashRecord<G>) -> Self
The same start with the game’s record of its play, which a backend
that catches a panic adds to its crash report
(App::crash_record). A record should not hold what the player
typed (a name).
Sourcepub fn before_load(self, before: impl FnOnce(&mut Setup) + 'static) -> Self
pub fn before_load(self, before: impl FnOnce(&mut Setup) + 'static) -> Self
The same start with before run on the setup ahead of the game’s
load: a backend’s own part (the voice manifest it read).