mod tiers;
use super::{Perform, WORKED_EXAMPLE_ID, lesson_start_spec};
pub(super) const MAIN_RING: &str = "0, 12, 24, 36, 48, 60, 72, 84";
#[derive(Clone, Debug)]
pub(super) enum Action {
Do(Perform),
SkipOnly,
}
#[derive(Clone, Debug)]
pub(super) struct TableEntry {
pub guide: &'static str,
pub step: &'static str,
pub action: Action,
}
pub(super) fn recipe(guide: &'static str, step: &'static str, perform: Perform) -> TableEntry {
TableEntry {
guide,
step,
action: Action::Do(perform),
}
}
pub(super) const fn skip(guide: &'static str, step: &'static str) -> TableEntry {
TableEntry {
guide,
step,
action: Action::SkipOnly,
}
}
pub(super) fn entries() -> Vec<TableEntry> {
let mut entries = worked_example();
entries.extend(tiers::entries());
entries
}
fn worked_example() -> Vec<TableEntry> {
let id = WORKED_EXAMPLE_ID;
vec![
recipe(
id,
"Start a new design",
Perform::NewDesign {
template_index: 0,
spec: Box::new(lesson_start_spec(0)),
},
),
recipe(
id,
"Add the girdle first",
Perform::add_tier("90.0", 2, "1.0", "G1", MAIN_RING),
),
recipe(
id,
"Add the pavilion main facets",
Perform::add_tier("-40.0", 2, "0.56", "P1", MAIN_RING),
),
recipe(
id,
"Add the crown main facets",
Perform::add_tier("34.5", 2, "0.70", "C1", MAIN_RING),
),
recipe(
id,
"Add the table",
Perform::add_tier("0.0", 2, "0.46", "T", ""),
),
skip(id, "Yield and rendering (optional)"),
]
}