Skip to main content

BasicTools

Struct BasicTools 

Source
pub struct BasicTools<A: ActionSet, T: Debug + 'static = ()> { /* private fields */ }
Expand description

The tools of a game on the short path.

Implementations§

Source§

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

Source

pub fn new(game: BasicGame<A, T>) -> Self

The tools of game.

Source

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

The game in the Harness, at its first screen; or its files’ problems, one per line, or the module that can’t be installed.

Source

pub fn picture( h: &Harness<BasicData<A, T>>, scale: u32, ) -> Result<Image, String>

The frame h shows, each console pixel scale × scale pixels, painted with the game’s font and pictures.

Trait Implementations§

Source§

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

Source§

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

Formats the value using the given formatter. Read more
Source§

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

Source§

fn session_from( &self, record: &SessionRecord, stamps: Stamps, ) -> Result<Box<dyn Session>, String>

The record played from the game’s real start (BasicGame::start).

Source§

fn made(&self) -> Option<Made>

BasicGame::made, which its session records carry.

Source§

fn font_atlas(&self) -> Option<Result<FontAtlasDef, String>>

The font atlas it loads, which check checks its text against.

Source§

fn controls(&self) -> Option<Result<Box<dyn Controls>, String>>

Its keymap and every screen it can show (BasicGame::screens).

Source§

fn frame_options(&self) -> &[GameOption]

The options the game adds to frame-png, which also start its game for run, scene and playtest (none: &[]).
Source§

fn frame( &self, options: &[GameArg], script: &Script, scale: Option<u32>, ) -> Result<Shot, String>

Starts the game in its Harness as options say, plays script and paints the frame, each console pixel scale × scale (the game’s choice if None).
Source§

fn lang(&self) -> Result<GameLang, String>

The game’s languages.
Source§

fn check(&self) -> Result<Vec<ContentError>, String>

check: every error of every validator of the game’s content, each with its file and, when known, its line.
Source§

fn session(&self, options: &[GameArg]) -> Result<Box<dyn Session>, String>

run and scene: the game started headless as options say (its frame_options), most simply a Headless over its Harness.
Source§

fn frame_notes(&self) -> &'static str

What else frame-png --help says about the game’s pictures.
Source§

fn frame_one_bit( &self, target: &str, options: &[GameArg], script: &Script, scale: Option<u32>, ) -> Result<Shot, String>

frame-png --target <id> on a one-bit target: as frame, but painted as the target’s display shows it, most simply with to_one_bit and one_bit_picture, each of its pixels scale × scale (1 if None).
Source§

fn session_on( &self, target: &str, options: &[GameArg], ) -> Result<Box<dyn Session>, String>

bench on a one-bit target: the game started headless as options say on target target (its console and its buttons), each frame converted as the device converts it, most simply a Headless over its Harness on that target with a set_present_hook that runs to_one_bit on the frame. Left at its default, bench measures session there and says the frames weren’t converted.
Source§

fn replay(&self, record: &Record) -> Result<ReplayRun, String>

replay: record, in the game’s record format, re-run by its rules (for a turn game, turns).
Source§

fn playtest_stages(&self) -> Vec<String>

playtest --stage: the ids of the game’s playtest stages, in the order --every-stage plays them. Empty, the default: one unnamed stage.
Source§

fn playtest_plan( &self, stage: Option<&str>, input: &PlaytestInput, ) -> Result<PlaytestPlan, String>

playtest: the plan of stage (one of playtest_stages, None if there are none), started as input’s game options say. Its numbers are those the tries are played with, the game’s defaults filled in. A game’s bot run is a plan too: one entrant and no checks.
Source§

fn playtest_defaults(&self) -> Tries

playtest: how many tries, from which seed, stopped at which turn, when the input doesn’t say. The engine’s defaults (DEFAULT_TRIES) unless the game has its own.
Source§

fn autobalance_plan( &self, stage: Option<&str>, input: &AutobalanceInput, ) -> Result<AutobalancePlan, String>

autobalance: the plan of stage (one of playtest_stages, None if there are none), started as input’s game options say. Its numbers are those the search runs with, the defaults filled in.
Source§

fn importers(&self) -> Importers

import: the kinds and formats to read a file with. The engine’s standard ones unless the game adds its own.
Source§

fn one_bit(&self, _target: &str) -> Option<Result<OneBitSkin, String>>

check --target on a one-bit target: the skin’s palette and its pattern map for target, for the check that every role has patterns and the roles that tell things apart stay distinct (ADR-0008 §4; shuyi_assets::onebit::check). None, the default, doesn’t offer them, and check --target says they weren’t checked. An error (the files don’t load) fails the check.
Source§

fn bake(&self, target: Option<&str>) -> Result<GameBake, String>

bake and check --baked: what the game bakes for target (None for its default bundle), from which bundle, read with which formats. The target is the game’s to pick layers and kinds by.
Source§

fn audio(&self, target: &str) -> Result<GameAudio, String>

export on a target that bakes its audio (the Playdate’s): the sounds and music the game ships on target, whose profile’s id it is. A game that leaves this at its default is silent there.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<A, T> UnwindSafe for BasicTools<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> 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, 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.