pub struct BasicGame<A: ActionSet, T: Debug + 'static = ()> { /* private fields */ }Expand description
A game on the short path: its data is a BasicData of actions A
and its own part T, read from one layer of files.
Implementations§
Source§impl<A: ActionSet, T: Debug + 'static> BasicGame<A, T>
impl<A: ActionSet, T: Debug + 'static> BasicGame<A, T>
Sourcepub fn with_own(
app: AppInfo,
files: Layer,
own: Own<T>,
first: First<A, T>,
) -> Self
pub fn with_own( app: AppInfo, files: Layer, own: Own<T>, first: First<A, T>, ) -> Self
As BasicGame::new, for a game with a part of its own, which
own reads from its files (BasicData::own).
Sourcepub fn console(self, console: ConsoleSpec) -> Self
pub fn console(self, console: ConsoleSpec) -> Self
The same game on console (BASIC_CONSOLE until said).
Sourcepub fn screens(self, screens: Screens<A, T>) -> Self
pub fn screens(self, screens: Screens<A, T>) -> Self
The same game, with screens every screen it can show (its first
alone until said).
Sourcepub fn modules(self, modules: Modules<A, T>) -> Self
pub fn modules(self, modules: Modules<A, T>) -> Self
The same game, with the modules modules makes installed in its
Game (none until said).
Sourcepub fn crash_record(self, hook: CrashRecord<BasicData<A, T>>) -> Self
pub fn crash_record(self, hook: CrashRecord<BasicData<A, T>>) -> Self
The same game, with hook its record of its play in a crash
report (Start::crash_record; none until said).
Sourcepub fn storage_name(&self) -> &'static str
pub fn storage_name(&self) -> &'static str
The name its saves are kept under.
Sourcepub fn console_spec(&self) -> ConsoleSpec
pub fn console_spec(&self) -> ConsoleSpec
The console it starts on.
Sourcepub fn over(self, layer: Layer) -> Self
pub fn over(self, layer: Layer) -> Self
The same game with layer laid over its files: a folder on disk
(shuyi_app::watched_layer, cargo shuyi run --watch), or a mod.
Sourcepub fn bundle(&self) -> Bundle
pub fn bundle(&self) -> Bundle
Its files, as a bundle of their one layer, under the one laid
over them if it has one.
Sourcepub fn data(&self) -> Result<BasicData<A, T>, Vec<ContentError>>
pub fn data(&self) -> Result<BasicData<A, T>, Vec<ContentError>>
Its data from its files, or every problem of every file.
Sourcepub fn ctx(&self) -> Result<Ctx<BasicData<A, T>>, String>
pub fn ctx(&self) -> Result<Ctx<BasicData<A, T>>, String>
Its context, in its keymap file’s first layout; or every problem of its files, one per line.
Sourcepub fn game(
&self,
ctx: Ctx<BasicData<A, T>>,
) -> Result<Game<BasicData<A, T>>, ModuleError>
pub fn game( &self, ctx: Ctx<BasicData<A, T>>, ) -> Result<Game<BasicData<A, T>>, ModuleError>
The game on ctx, at its first screen, with its
modules installed; or why one could not be.
Sourcepub fn every_screen(
&self,
ctx: &mut Ctx<BasicData<A, T>>,
) -> Vec<Box<dyn Screen<BasicData<A, T>>>>
pub fn every_screen( &self, ctx: &mut Ctx<BasicData<A, T>>, ) -> Vec<Box<dyn Screen<BasicData<A, T>>>>
Every screen it can show (screens), made on
ctx.
Sourcepub fn made(&self) -> Made
pub fn made(&self) -> Made
What made this build, for its records: its id and version as the game’s word, and the fingerprint of its files.
Sourcepub fn start(self) -> Start<BasicData<A, T>>
pub fn start(self) -> Start<BasicData<A, T>>
How a backend starts it: a card with its name, then its context on
the platform and its first screen. A file that doesn’t load, or a
module that can’t be installed, is the load’s error, which the
platform shows in place of the game. A session record of it carries
its made, and each frame’s hash the state hash of its
screens (Screen::state_hash). A crash report carries its
crash_record, if it has one.