Skip to main content

BasicGame

Struct BasicGame 

Source
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> BasicGame<A>

Source

pub fn new(app: AppInfo, files: Layer, first: First<A, ()>) -> Self

The game app (its name, and the storage its saves are kept under), its files in files, starting on the screen first makes.

Source§

impl<A: ActionSet, T: Debug + 'static> BasicGame<A, T>

Source

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).

Source

pub fn console(self, console: ConsoleSpec) -> Self

The same game on console (BASIC_CONSOLE until said).

Source

pub fn screens(self, screens: Screens<A, T>) -> Self

The same game, with screens every screen it can show (its first alone until said).

Source

pub fn modules(self, modules: Modules<A, T>) -> Self

The same game, with the modules modules makes installed in its Game (none until said).

Source

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).

Source

pub fn app(&self) -> AppInfo

Who it is.

Source

pub fn name(&self) -> &'static str

Its name: the window’s title and the loading card’s line.

Source

pub fn storage_name(&self) -> &'static str

The name its saves are kept under.

Source

pub fn console_spec(&self) -> ConsoleSpec

The console it starts on.

Source

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.

Source

pub fn bundle(&self) -> Bundle

Its files, as a bundle of their one layer, under the one laid over them if it has one.

Source

pub fn data(&self) -> Result<BasicData<A, T>, Vec<ContentError>>

Its data from its files, or every problem of every file.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn harness(&self) -> Harness<BasicData<A, T>>

The game in the test Harness, at its first screen.

§Panics

If its files don’t load, or a module can’t be installed: the panic gives every problem.

Trait Implementations§

Source§

impl<A: ActionSet, T: Debug + 'static> Clone for BasicGame<A, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: ActionSet, T: Debug + 'static> Copy for BasicGame<A, T>

Source§

impl<A: ActionSet, T: Debug + 'static> Debug for BasicGame<A, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<A, T> Freeze for BasicGame<A, T>

§

impl<A, T> RefUnwindSafe for BasicGame<A, T>

§

impl<A, T> Send for BasicGame<A, T>

§

impl<A, T> Sync for BasicGame<A, T>

§

impl<A, T> Unpin for BasicGame<A, T>

§

impl<A, T> UnsafeUnpin for BasicGame<A, T>

§

impl<A, T> UnwindSafe for BasicGame<A, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.