Skip to main content

Module catalog

Module catalog 

Source
Expand description

The engine’s modules as the tools read them (ADR-0009 §2, §4, §6), for modules and add (crate::contract::modules, crate::contract::add):

  • Concerns: the concerns a game answers and their answers, the engine’s docs/modules.ron;
  • ModuleInfo: what a module’s crate says it answers, its [package.metadata.shuyi], read with its crate into a ModuleCrate;
  • Catalog: the two read from an engine checkout, with its skill pack, and engine_root, which finds the checkout a game builds with;
  • a game’s Cargo.toml: the shuyi features it has on (features_on), and one more turned on (turn_on);
  • a module’s package folder: the first paragraph of its README (readme_paragraph) and its skill (skill_of, copy_skill).

A module’s feature of the shuyi crate is its crate’s name without shuyi- (feature_of).

Structs§

Answered
One concern a module answers, and its answer.
Catalog
What the tools know of an engine checkout: its concerns, the modules it builds and its skill pack.
Choice
One answer to a concern.
Concern
A question every game answers one way or another.
Concerns
The concerns a game answers, docs/modules.ron.
ModuleCrate
A module’s crate: its name, its package folder and its metadata.
ModuleInfo
A module’s [package.metadata.shuyi] (ADR-0009 §4): what it answers, what it is built for, and what it sits beside.

Enums§

SkillCopy
What copy_skill did.
Status
Whether an answer or a module is built.

Constants§

CONCERNS
The concerns, from the engine’s root.
DEFAULT_CRATES
The crates of the default engine, which are no modules.
SKILLS
Where a game keeps its agent’s skills, from its folder.

Functions§

copy_skill
Copies the skill folder skill into the skills of the game at game as name: its regular files, at any depth (a link is skipped).
engine_root
The engine checkout the game at game builds with: the folder above the shuyi crate its Cargo.toml names by path, or else the one cargo resolved it to (cargo metadata, run through the CARGO variable).
feature_of
The feature of the shuyi crate that turns on module name: its name without shuyi- (physics).
features_on
The features of the shuyi crate a Cargo.toml’s text turns on.
installs_modules
Whether a Rust file of the game at game (outside target/ and hidden folders) names shuyi::enabled_modules, which installs the modules its features turn on.
module_of
The module that feature feature of the shuyi crate turns on.
modules_of_features
The modules the shuyi crate’s Cargo.toml (manifest) has a feature for, one a feature but default, by name, with no metadata.
readme_paragraph
The first paragraph of the README in package folder dir, after its title: what the module is for (ADR-0009 §4).
skill_of
The skill of the module name in package folder dir: its own skill/ folder, or the one named for it in the skill pack of the repository it is in (skills/<name>, two folders up), whichever holds a SKILL.md.
turn_on
A Cargo.toml’s text with feature feature of the shuyi crate turned on, its layout kept; None if it is already on.