pub struct BasicTools<A: ActionSet, T: Debug + 'static = ()> { /* private fields */ }Expand description
The tools of a game on the short path.
Implementations§
Trait Implementations§
Source§impl<A: ActionSet, T: Debug + 'static> GameTools for BasicTools<A, T>
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>
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 font_atlas(&self) -> Option<Result<FontAtlasDef, String>>
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>>
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]
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>
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 check(&self) -> Result<Vec<ContentError>, String>
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>
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
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>
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>
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 playtest_stages(&self) -> Vec<String>
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>
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
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>
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
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>>
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.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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more