Expand description
Who the game is: shuyi.ron’s app part (AppPart, ADR-0059), its
rules (problems, which check --target reports), and app-info,
which writes it as the Rust constant the game’s binary compiles
(rust, run) and the window’s icons, downscaled from the game’s
one icon (downscale, ADR-0061) or drawn per size (ADR-0069).
The rules:
name: not empty, with no control character;id: reverse-DNS, two or more parts between dots, each of ASCII letters, digits and-, starting with a letter; an id undercom.example.is a warning, since two games with it share their saves;version, when given: semver,MAJOR.MINOR.PATCHthen an optional-pre-releaseand+build;build: 1 or more;storage, or the id when it is unset: one folder name;icon, when given: a PNG file, square,ICON_SIDEpixels a side or more;window_icons: set wheniconandcodeare, since the Rust reads the window’s icons from there;icon_sizes: each key one ofWINDOW_ICON_SIDES, each file a PNG square at its key’s side, withiconandwindow_iconsset, since the sizes it doesn’t draw come from the icon and it fills that folder;- the files
app-infowrites (codeand the window’s icons) are the ones on disk.
Structs§
- AppProblem
- A problem of the
apppart. - Icon
- The game’s icon:
side×sideRGBA8 pixels.
Constants§
- COMMAND
- The command’s name.
- ICON_
SIDE - The smallest side of the game’s icon, in pixels: every size a target asks is downscaled from it, never scaled up.
- PLACEHOLDER
- The id’s start that marks it as a placeholder.
- WINDOW_
ICON_ SIDES - The window’s icons’ sides, in pixels:
WindowIcon’s small, medium and big.
Functions§
- check_
id - Whether
idis a reverse-DNS id: two or more parts between dots, each of ASCII letters, digits and-, starting with a letter. These are the characters Apple allows in a bundle id, with a letter first as Android asks. - check_
storage - Whether
storagecan name a folder on every system: ASCII letters, digits,.,-,_and spaces, with no.or space first or last. - check_
version - Whether
versionis semver:MAJOR.MINOR.PATCHin digits, then an optional-pre-releaseand+build. - downscale
rgba, awidth×heightpicture of RGBA8 pixels, downscaled tosize×size, in integers, so the same picture gives the same bytes everywhere (ADR-0061). Each pixel out is the mean of the pixels of its square in, fromx * width / sizeup to(x + 1) * width / size(and the same down), in premultiplied alpha, so a transparent pixel adds nothing to the colour beside it; each mean is rounded half up.- files
- The files
app-infowrites forpartin the project atroot: each path from the root and its bytes, the Rust file and then the window’s icons, each the pictureicon_sizesdraws for its side, else downscaled from the icon. Fails when the icon or a drawn picture doesn’t load. - icon
part’s icon, read from the project atrootand checked: a PNG file, square,ICON_SIDEpixels a side or more.Nonewhen the part names none.- parse_
args app-info’s arguments: none, or--check.Ok(true)for--check.- problems
- Every problem of
part, in the project atrootwhose tool is calledcommand: its fields and its icon by the rules, and each fileapp-infowrites that isn’t the one on disk. - run
app-info [--check]onpartin the project atroot: writes its files, or withcheckwrites nothing and fails naming each file that differs. A part with an error writes nothing and fails with them.- rust
- The Rust file
app-infowrites forpart, withcommandas the tool’s name: onepub const APP: AppInfo, kept fromrustfmt, soapp-info --checkis its only judge. - stale
- The files
app-infowould write forpartthat differ from those inroot(a missing file differs), by their paths. A text file’s line endings don’t count. When the icon or a drawn picture doesn’t load, the window’s icons aren’t compared: its rule says why.