#[non_exhaustive]pub enum Step {
Keys(String),
Pad(String),
Act(String),
Wait(f32),
Crank(f32),
Debug(String),
}Expand description
One step of a script, played in the order written.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Keys(String)
Each whitespace-separated key chord pressed in one frame and let go
in the next, in turn ("Enter Up Shift+Space").
Pad(String)
Each whitespace-separated controller button pressed in one frame
and let go in the next, in turn ("South"; "East+DpadDown":
those buttons together).
Act(String)
The game’s action of that name (Confirm), pressed by the player’s
primary key for it, or its primary button if it has no key.
Wait(f32)
That many seconds of frames with no input, 60 a second, rounded up.
Crank(f32)
The crank wound that many degrees in one frame (backwards is negative), as a Playdate front end reports it.
Debug(String)
Debug tools and the debug view’s channels of these comma-separated
ids turned on from here on ("grid,collision"; "all" turns on
every channel, offered or not), and the frame drawn again: no frame
passes (ADR-0085). Played by the Harness only.
Implementations§
Source§impl Step
impl Step
Sourcepub fn check(&self) -> Result<(), String>
pub fn check(&self) -> Result<(), String>
Whether it can be played: names Chord::parse and Button::parse
know, an action named, a wait that is a number of seconds, 0 or
more, and a crank’s number of degrees. An action’s name is looked
up when it plays, in the game’s keymap; the longest wait is the
player’s to check (check_waits).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Step
impl<'de> Deserialize<'de> for Step
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Step, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Step, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Step
impl JsonSchema for Step
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more