pub struct BasicGame<A, T = ()>{ /* 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, T> BasicGame<A, T>
impl<A, T> BasicGame<A, T>
Sourcepub fn with_own(
app: AppInfo,
files: Layer,
own: fn(&Bundle) -> Result<T, Vec<ContentError>>,
first: fn(&mut Ctx<BasicData<A, T>>) -> Box<dyn Screen<BasicData<A, T>>>,
) -> BasicGame<A, T>
pub fn with_own( app: AppInfo, files: Layer, own: fn(&Bundle) -> Result<T, Vec<ContentError>>, first: fn(&mut Ctx<BasicData<A, T>>) -> Box<dyn Screen<BasicData<A, T>>>, ) -> BasicGame<A, T>
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) -> BasicGame<A, T>
pub fn console(self, console: ConsoleSpec) -> BasicGame<A, T>
The same game on console (BASIC_CONSOLE until said).
Sourcepub fn screens(
self,
screens: fn(&mut Ctx<BasicData<A, T>>) -> Vec<Box<dyn Screen<BasicData<A, T>>>>,
) -> BasicGame<A, T>
pub fn screens( self, screens: fn(&mut Ctx<BasicData<A, T>>) -> Vec<Box<dyn Screen<BasicData<A, T>>>>, ) -> BasicGame<A, T>
The same game, with screens every screen it can show (its first
alone until said).
Sourcepub fn modules(
self,
modules: fn() -> Vec<Box<dyn Module<BasicData<A, T>>>>,
) -> BasicGame<A, T>
pub fn modules( self, modules: fn() -> Vec<Box<dyn Module<BasicData<A, T>>>>, ) -> BasicGame<A, T>
The same game, with the modules modules makes installed in its
Game (none until said).
Sourcepub fn crash_record(
self,
hook: fn(&Game<BasicData<A, T>>) -> Option<String>,
) -> BasicGame<A, T>
pub fn crash_record( self, hook: fn(&Game<BasicData<A, T>>) -> Option<String>, ) -> BasicGame<A, T>
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) -> BasicGame<A, T>
pub fn over(self, layer: Layer) -> BasicGame<A, T>
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.